Table inheritance with Doctrine

Currently I am programming a web-application with Symfony. In this app we got different kind of users: patients, doctors, experts, admins and so on. All of these users share some attributes (username, password, email), but some attributes only apply to several usertypes. A doctor for example has a departement, an expert a phone-number etc.

In the object oriented world of PHP this is an easy task: Patient extends User. But thanks to the magic of Doctrine this can be used within MySQL as well!

Daniel Barsotti wrote an excellent post about it: http://blog.liip.ch/archive/2012/03/27/table-inheritance-with-doctrine.html

Works like a charm!

About 

Hi, I'm a Berlin-based developer and working on webstuff since 2000. My focus lies on PHP, TYPO3 and Symfony. 2009 I became a certified TYPO3-Integrator. I worked on projects for clients like Paypal, Union Investment, Commerzbank or Warsteiner.

Go check out my page http://www.christian-baer.com

Published by

Christian Baer

Hi, I'm a Berlin-based developer and working on webstuff since 2000. My focus lies on PHP, TYPO3 and Symfony. 2009 I became a certified TYPO3-Integrator. I worked on projects for clients like Paypal, Union Investment, Commerzbank or Warsteiner. Go check out my page http://www.christian-baer.com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">