Pimcore\Model\Element\Tag::batchAssignTagsToElement PHP Method

batchAssignTagsToElement() public static method

public static batchAssignTagsToElement ( $cType, array $cIds, array $tagIds, boolean | false $replace = false )
$cType
$cIds array
$tagIds array
$replace boolean | false
    public static function batchAssignTagsToElement($cType, array $cIds, array $tagIds, $replace = false)
    {
        $tag = new Tag();
        $tag->getDao()->batchAssignTagsToElement($cType, $cIds, $tagIds, $replace);
    }

Usage Example

Beispiel #1
0
 public function doBatchAssignmentAction()
 {
     $cType = strip_tags($this->getParam("elementType"));
     $assignedTags = json_decode($this->getParam("assignedTags"));
     $elementIds = json_decode($this->getParam("childrenIds"));
     $doCleanupTags = $this->getParam("removeAndApply") == "true";
     Tag::batchAssignTagsToElement($cType, $elementIds, $assignedTags, $doCleanupTags);
     $this->_helper->json(['success' => true]);
 }