Welcome Guest, Not a member yet? Register   Sign In
WebTigers: Working with Doctrine ORM, Part 1
#7

[eluser]webtigers[/eluser]
[quote author="cold_fusion" date="1288489839"][quote author="WebTigers" date="1288486255"][quote author="cold_fusion" date="1288399879"]When using Doctrine as CI plugin, do we really have to write the DQL queries directly in our controllers or there is a way for writing them in doctrine models and them call those models from controllers (just like we would normally do if not using Doctrine)?[/quote]

Simple object method calls are fine. But you really should not have complex DQL queries in your controllers. Doing so breaks the MVC separation rules. Place complex queries within the model as a function and then call that function with whatever appropriate params from the controller once the object is instantiated. Much cleaner this way also. Smile[/quote]

is this a proper way to call a method from Doctrine Model:
Code:
$var = Doctrine::getTable('Someclass');
$data['categories'] = $var->methodName($param1, $param2);

I have something like this but it doesnt work![/quote]

Check out http://www.doctrine-project.org/document...-to-models

and

http://www.doctrine-project.org/projects...-models/en


Messages In This Thread
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 07-11-2010, 07:37 AM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 09-27-2010, 09:16 AM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 10-29-2010, 01:51 PM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 10-30-2010, 01:50 PM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 10-30-2010, 01:53 PM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 10-30-2010, 02:50 PM
WebTigers: Working with Doctrine ORM, Part 1 - by El Forum - 11-01-2010, 05:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB