Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [phoenix-dev] Addition to ProjectInfoValues class

Okay, will do.

I also just found another bug:

The last "else" needs to track whether it has already looped on a given ProjectInfoID since it's a recursive loop. Otherwise you get as many ProjectInfoValues records returned for each ProjectInfoID as there are keys. I added the $checked array to handle this.

                   } else {
                       $result = array();
                       $checked = array();
                       foreach( $this->rows as $rr ) {
                           if(isset($checked[$rr['ProjectInfoID']])) {
                               continue;
                           }
                           $checked[$rr['ProjectInfoID']] = true;
                           if( $rr['MainKey'] == $mainkey) {
                               $subrows = array();
                               foreach( $this->rows as $rrr ) {
if( $rr['ProjectInfoID'] == $rrr['ProjectInfoID']) {
                                       $subrows[] = $rrr;
                                   }
                               }
$result[] = new ProjectInfoValues( $this, $subrows );
                           }
                       }
                       return $result;
                   }

Karl


Nathan Gervais wrote:
Sounds good to me, go ahead and commit this to Phoenix CVS

+1

Nathan Gervais - nathan@xxxxxxxxxxx
Web Developer The Eclipse Foundation
-----Original Message-----
From: phoenix-dev-bounces@xxxxxxxxxxx
[mailto:phoenix-dev-bounces@xxxxxxxxxxx] On Behalf Of Karl Matthias
Sent: Monday, September 17, 2007 2:39 PM
To: For developers on the new Eclipse.org website project.
Subject: [phoenix-dev] Addition to ProjectInfoValues class

I discovered that if you need to iterate over the fields in the ProjectInfoValues class without knowing ahead of time what they are, it's pretty hard. I added a function that will allow you to do that:

    function fields() {
        $fields = array();
        foreach($this->rows as $row) {
            $fields[] = $row['SubKey'];
        }
        return $fields;
    }

Pretty simple, but quite helpful.  Shall we add this to the phoenix cvs?

Karl
_______________________________________________
phoenix-dev mailing list
phoenix-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/phoenix-dev

_______________________________________________
phoenix-dev mailing list
phoenix-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/phoenix-dev



Back to the top