示例#1
0
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 public function testGetEntityData()
 {
     $this->assertEquals($this->entityData, $this->event->getEntityData());
 }