This topic contains 2 replies, has 1 voice, and was last updated by William Radi 5 years, 9 months ago.
- Topic
Hi!
I created a new entity and I’d like to made it auditable.
I changed my entity’s properties following this page and their annotations are looking like this:Class annotation:
1234567891011121314/*** @Config(* defaultValues={* "dataaudit"={* "auditable"=true* },* "security"={* "type"="ACL",* "category"="account_management"* }* }* )*/class ...Exemple of propertie annotation:
12345678910111213/*** @var \DateTime** @ORM\Column(type="date")* @ConfigField(* defaultValues={* "dataaudit"={* "auditable"=true* }* }* )*/private $date;It by itself didn’t work.
So, I saw in Oro Github that some entityes has migrations with auditable options. I made a migration too and it’s like that:123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354class SetAuditableTrue implementsMigration,OrderedMigrationInterface,NameGeneratorAwareInterface,ExtendExtensionAwareInterface{/*** @var ExtendDbIdentifierNameGenerator*/protected $nameGenerator;/*** @var ExtendExtension*/protected $extendExtension;/*** {@inheritdoc}*/public function getOrder(){return 2;}/*** {@inheritdoc}*/public function setNameGenerator(DbIdentifierNameGenerator $nameGenerator){$this->nameGenerator = $nameGenerator;}/*** {@inheritdoc}*/public function setExtendExtension(ExtendExtension $extendExtension){$this->extendExtension = $extendExtension;}public function up(Schema $schema, QueryBag $queries){$advertisingTable = $schema->getTable('advertising');$this->enableDataAudit($advertisingTable);}protected function enableDataAudit(Table $advertisingTable){$advertisingTable->addOption(OroOptions::KEY, ['dataaudit' => ['auditable' => true]]);$advertisingTable->getColumn('date')->setOptions([OroOptions::KEY => ['dataaudit' => ['auditable' => true]]]);}}But still not recording:
anyone can help me? :)
Thanks!
The forum ‘OroPlatform’ is closed to new topics and replies.