Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function executeAction($context)
 {
     $source = $this->getTaggable($context, static::PATH_SOURCE);
     $destination = $this->getTaggable($context, static::PATH_DESTINATION);
     $organization = $this->getOrganization($context);
     $this->tagManager->loadTagging($source, $organization);
     $tags = $this->tagManager->getTags($source);
     $this->tagManager->setTags($destination, $tags);
     $this->tagManager->saveTagging($destination, true, $organization);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getValue($entity, FieldMetadata $metadata)
 {
     return $this->tagManager->getTags($entity);
 }