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 » Fri Aug 23, 2013 10:38 pm

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 » Fri Aug 23, 2013 11:35 pm

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: 367
Joined: Fri Jul 08, 2011 9:43 pm

Re: Doctrine ORM

Post by JoshyPHP » Sat Aug 24, 2013 12:39 am

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: 905
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin » Sat Aug 24, 2013 8:34 am

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 » Tue Aug 27, 2013 9:14 pm

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: 905
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin » Tue Aug 27, 2013 11:37 pm

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 » Wed Aug 28, 2013 1:14 am

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: 905
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: Doctrine ORM

Post by hanakin » Wed Aug 28, 2013 3:02 am

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 » Thu Aug 29, 2013 9:59 pm

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 » Sat Aug 31, 2013 8:05 pm

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