/** * Save tags * * @param EntityDataEvent $event */ public function afterMergeEntity(EntityDataEvent $event) { $entityData = $event->getEntityData(); $entityMetadata = $entityData->getMetadata(); if (!$this->isTaggable($entityMetadata)) { return; } $entity = $entityData->getMasterEntity(); $this->tagManager->saveTagging($entity); }
/** * Save tags * * @param EntityDataEvent $event */ public function afterMergeEntity(EntityDataEvent $event) { $entityData = $event->getEntityData(); $entityMetadata = $entityData->getMetadata(); if (!$this->isTaggable($entityMetadata)) { return; } $masterEntity = $entityData->getMasterEntity(); $masterTags = $this->tagManager->getTags($masterEntity)->getValues(); $this->tagManager->setTags($masterEntity, ['all' => $masterTags, 'owner' => $masterTags]); $this->tagManager->saveTagging($masterEntity); }
public function testGetEntityData() { $this->assertEquals($this->entityData, $this->event->getEntityData()); }