Intellisense support for generated class from db schema

thread: 2 messages  |  last: about 8 months ago  |  started: thursday, september 1, 2011, 9:44 am pdt


#1  |  hokching
Thursday, September 1, 2011, 9:44 AM PDT

Hi,

I would like to request for a feature.

It is that, if I have loaded/instantiated a db table object, I can get a list of the properties/columns of the object.

I know it is mainly dealt with the IDE itself. I'm using Aptana Studio 3 and Zend Studio.

I think I can express myself more clearly with an example.

Let's say I have run codegen and got a class from table Staff, the table has only three columns: StaffID, StaffName and Dept.

1) so, if I instantiate it directly:

         $obj = new Staff();

Then I can successfully list out the methods/properties of the class when I type the “greater than” char of $obj->.

However, the list won't include the three columns. I've tested it on Aptana and ZDE.

I've looked at the generated code, and I found out that the three columns are included in the gen class, but are “protected”. But I can see that they are defined as properties in the comment directive of the class.

Is it possible to make it public, or any thing that makes the columns appear in the intellisense list?

2) Another thing is that, if I have to load it using a key value:

         $obj = Staff::LoadByKey(1);

Since the object is not directly instantiated, both the two IDEs cannot infer the type of $obj (I guess it's because the type info depends dynamically on the method's return type) and therefore it failed to produce the property list.

Is there a method that functions similar with the static method Loadbykey, but is an instance method instead?

Please help on the two issues... Coz they are preventing me to make good use of Qcodo.

Thanks!

#2  |  Mike Ho (San Diego, CA) United States of America Qcodo Administrator
Thursday, September 1, 2011, 10:05 AM PDT

Everything works great for me using Eclipse PDT.

Haven't tried it with the new Indigo release yet -- but I've been using the Helios release for about a year now, and the intellisense works almost flawlessly, although sometimes it's a bit slow to pop-up.  (Unfortunately, that's more of an issue with Eclipse/Java than anything else =).

When I'm working with code within a class, all of the protected/private member variables within that class show up perfectly on eclipse's intellisense.

And all of the static load methods all work well as well.

So bottom line -- if it's not working for you in Aptana or Zend (which I believe are both based on Eclipse PDT), then it's likely a bug within those commercial packages, and I'd open up a support ticket with those vendors.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.