How would one add constants (as in the example below) to an Entity class, when there is a risk of the entity being cleared and regenerated (to clean it up) some time in the future, without having to keep in mind there are constants for this Entity.
Would you generate the entity in Acme\DemoBundle\Entity as BaseEntity and extend the Entity which would contain the constants? (A bit like the 'Propel-way')
I would also like to keep the generated class clean from changes made by developers.
For example (very abstract)
<?php
namespace Acme\DemoBundle\Entity;
class Transition
{
const TYPE_ENTER = 0;
const TYPE_EXIT = 1;
// Generated fields (from .yml)
private $type; // Also generated
// Generated getters & setters (from .yml)
}
I usually add the constants to the interface that the models must implement rather than the model which may not even be used.