Welcome Guest, Not a member yet? Register   Sign In
Codeigniter plus Doctrine
#1

[eluser]newbie boy[/eluser]
What does Doctrine basically do with Codeigniter? I'm really lost...
#2

[eluser]sl3dg3hamm3r[/eluser]
Without knowing Doctrine in detail, the Doctrine's webpage tells me it is all about a DB-abstraction. Instead of using the CI's internal Database Active Recordset - Pattern, you can use Doctrine, which might be more powerful. Especially the ORM (Object-Relational Mapping) is an additional feature compared to CI's database-layer.

If you really need that is another question.
#3

[eluser]newbie boy[/eluser]
ORM (Object-Relational Mapping) is an additional feature compared to CI’s database-layer.
Can anyone explain this...
#4

[eluser]Pascal Kriete[/eluser]
CI's database layer essentially just removes the syntax differences of different database types. You're still doing the query logic yourself.

So if we take the typical blog example of posts and comments, the function you write to delete a post will also include a query to delete the comments.

ORM takes it a bit further by handling that logic for you. So if you tell Doctrine to delete a post, it will internally work out that it needs to delete the comments as well.

Make sense?
#5

[eluser]GSV Sleeper Service[/eluser]
I've been experimenting with Doctrine, it's very powerful, it can save a lot of time and coding, but it's also very tricky to shift your mind from dealing with 'traditional' recordsets to dealing with objects.
once you get the hang of it you'll love it, I found it very confusing at first, but it's worth persevering.
#6

[eluser]newbie boy[/eluser]
but is Doctrine would be the best for CI?
#7

[eluser]Pascal Kriete[/eluser]
It depends on your needs. CI works fine without Doctrine - and adding a layer of abstraction does mean slightly reduced performance. If you feel that your app will be better with ORM, by all means use it. Once you have it figured out it'll probably increase productivity a bit.
Remember to turn off active record (in the database config file) if you do decide to use it. Just to conserve some memory Smile .




Theme © iAndrew 2016 - Forum software by © MyBB