views:

61

answers:

2
class Model_User extends ORM {
  // columns: UserID, Name
  // public $Name ; // this didn't work
}

Currently I create an object: $user = new Model_User() ; and access columns like:

 $user->Name = 'My Name';

I'd like to have my IDE show me all the columns in the data model to avoid misspellings and to now right away what fields I can use.

How do I update my model to give my IDE the list of possible columns/properties? I tried adding the properties to the class but that broke the ORM() and no longer allowed saving. I must have overridden some base class property that gets set after reading in the column names from the database.

Any ideas how to do this?

+1  A: 

Use phpDoc's @property tag:

/**
   @property  string   Name     username
   @property  int      UserID   user ID (primary key)
 */
class Model_User extends ORM {
// ...
}
biakaveron
unforuntately doesn't work with NetBeans 6.9
M Sleman
I'll check it tomorrow
biakaveron
Make sure to prefix parameters with $.
M Sleman
A: 

Got it working, have to proceed property names with $

/**
  *   @property string $Name
  *   @property int $UserID
  */
M Sleman