I would like make log system for many Entity. For example i have Entity: Blog, Page and News. They are admin class:
class (Blog|Page|News/)Admin.php
{
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with('General')
->add('title', null, array())
->add('body', null, array())
->end();
}
}
I would like also Entity Log. This has fields: log, description and date. I would like add field description to Blog, Page and News:
class (Blog|Page|News)Admin.php
{
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with('General')
->add('title', null, array())
->add('body', null, array())
->add('description', 'text', array())
->end();
}
}
but this return error - this field not exist in Entity (Blog|Page|News). I can add setDescription, getDescription etc to Entity, but this is wrong way if i have a lot of entity to logging and i will have all logs in one table (Entity Log), not in all Entities - (Blog|Page|News). I use preUpdate to save this data to table Log, but i dont know how i can add field description from Entity Log to these Entities. I can also make relation but this is also wrong way. Maybe i should use extends class? But how?