Doctrine ORM

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Doctrine DBAL & ORM

Post by bantu »

I have used the Doctrine ORM in one of my projects. As soon as your logic gets a bit more complex and you add things like aggregation, you start working around the ORM. An ORM probably works well for trivial projects such as websites, but it won't work for phpBB. The interface to use to talk to the database should be SQL.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Doctrine ORM

Post by MichaelC »

The advantages of an ORM are as follows:
  • Neater
  • You don't need to use SQL, just PHP
  • Easy to pick up
  • Organised entities
  • The model data is all together so it’s easier to update, maintain and reuse.
  • Handles sanitization etc. when you persist to the database
The ORM can be used for all new database objects and older ones can be refactored to use it. Essentially to edit something in the database you manipulate an object rather than do direct SQL although you can still use the DBAL/SQL when the ORM does not provide enough control for your usage.

This depends on the Doctrine DBAL and would likely be for 3.2.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: Doctrine ORM

Post by JoshyPHP »

How long would it take to write a basic model for the main objects used in phpBB? A PoC would surely help people form an opinion or update their old opinion. I haven't used Doctrine since the early 2.0 versions, and back then it lacked some features that made me forgo trying to use it. I haven't had the occasion to use it since then. I'd wager that a lot of people have had a similar experience.

IIRC, the two pain points were auto_incremented IDs in mutually referencing records and composite indices (perhaps unique composite indices, can't remember exactly.)

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin »

are you wanting to come up with one for phpbb or implement one that already exists? Also isn't their one included in symphony? I have not worked with symphony at all but I have worked with Larval which uses eloquent
Donations welcome via Paypal Image

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Doctrine ORM

Post by brunoais »

MichaelC wrote:The advantages of an ORM are as follows:
  • You don't need to use SQL, just PHP
Are you sure that's an advantage?
I've always been confused with abstractions... (hence I can't handle rails)
MichaelC wrote:
  • Handles sanitization etc. when you persist to the database
Does it sanitize it really properly or it almost does it properly?
The tendency I see too much is not to do stuff properly and do it such that it just works...

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin »

it makes it more readable and adds better ability to work with crud for apis in my opinion
Donations welcome via Paypal Image

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: Doctrine ORM

Post by Pony99CA »

For those of us who have no idea what you're talking about, what is an ORM? I searched and there were several definitions that seemed to fit.

Remember, one principle of good communication is defining your acronyms when first used. ;)

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin »

ORM stands for Object Relational Mapper here is an article detailing how to use the eloquent ORM along with a basic level description http://codehappy.daylerees.com/eloquent-orm
Donations welcome via Paypal Image

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Doctrine ORM

Post by MichaelC »

Pony99CA wrote:For those of us who have no idea what you're talking about, what is an ORM? I searched and there were several definitions that seemed to fit.

Remember, one principle of good communication is defining your acronyms when first used. ;)

Steve
This is a board for technical discussion and I used a technical term which the majority of developers here will know what it refers to whilst others can, as you stated, google it. I also described what an ORM did.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Doctrine ORM

Post by imkingdavid »

For those who are unaware of what Doctrine ORM is, here is the website where it gives a brief definition as well as documentation with examples.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Post Reply