Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Using Code Help after loading class with Doctrine_Core::getClass
Using Code Help after loading class with Doctrine_Core::getClass [message #642134] Tue, 30 November 2010 03:14 Go to next message
Juliano  is currently offline Juliano Friend
Messages: 2
Registered: November 2010
Junior Member
Hello!

I'm starting with Doctrine and Eclipse. Suppose that I have a model called Product.php with a getLastPrice() method. After I have instanciated the Product class, is it possible to make the code help show the methods of the loaded class? I'm using a Bootstrap.php file to store the Doctrine configurations, and those configurations load automatically (at runtime) the model classes and the Doctrine classes.

I'm doing this:
// This file make auto load the models classes and the Doctrine classes
require('DoctrineBootstrap.php');
...
...

$Product = Doctrine_Core::getClass('Product');

After this, I would like to write "$Product->" and then the code help of Eclipse should show me the list of available methods (in the example above, the getLastPrice() method).

Anyone know if is it possible?

One more information: if I do:
require('models/Product.php');
$Product = new Product();

The code help work as expected.

Thanks!

Regards,

Juliano
Re: Using Code Help after loading class with Doctrine_Core::getClass [message #642662 is a reply to message #642134] Thu, 02 December 2010 08:57 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Add type comment as...

$Product = Doctrine_Core::getClass('Product');
/* @var $Product Product */
$Product->

See also
Help > PDT User Guide > Concepts > Content Assist > Class Type Hints
Re: Using Code Help after loading class with Doctrine_Core::getClass [message #642691 is a reply to message #642662] Thu, 02 December 2010 11:40 Go to previous messageGo to next message
Juliano  is currently offline Juliano Friend
Messages: 2
Registered: November 2010
Junior Member
Hello Toshihiro!

It is exactly what I wanted. Thanks a lot!

Regards,

Juliano
Re: Using Code Help after loading class with Doctrine_Core::getClass [message #646169 is a reply to message #642134] Wed, 22 December 2010 13:40 Go to previous message
dominik is currently offline dominikFriend
Messages: 122
Registered: July 2009
Senior Member
On 2010-11-30 04:14, Juliano wrote:
> I'm doing this:
> // This file make auto load the models classes and the Doctrine classes
> require('DoctrineBootstrap.php');
>
> $Product = Doctrine_Core::getClass('Product');

Doctrine will generate classes for each model and it's table, so You should be
able to type:

{{{
$product = new Product();
}}}

Then Eclipse will know what class is that.

dmc :)
Previous Topic:Web service Debugging?
Next Topic:XDebug JIT Breaking on first line of code
Goto Forum:
  


Current Time: Wed Apr 24 16:12:36 GMT 2024

Powered by FUDForum. Page generated in 0.03047 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top