Simple Object Inheritance in FLOW3

Think about two objects. One of them we want to call Income and the other one Spending. Both of them share the very same properties:

  • They have an amount
  • They are based on a currency
  • Probably they also have a date
These two entities are both transactions. Positive and negative transactions. But their attributes are pretty much the same.
We now can define one Base class where both can inherit from.

The classes which inherit from this base class now look very simple:

The keyword in this whole thing is the annotation in the base class:

With that Doctrine creates only the income and spendings tables but NOT a table like ‘base’. This sounds pretty obvious but if you don’t know about this annotation it can drive you mad …

UPDATE: Please note that every mention of FLOW3 changed to Flow since the release of TYPO3 Flow version 2.