Created
February 17, 2020 11:54
-
-
Save factoryhr/f1fd20cfe460ee38787dc3e0e86d7e7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tagListing = new \Pimcore\Model\Element\Tag\Listing(); | |
$tagListing->addConditionParam(‘name LIKE :term’, [‘term’ => ‘%’ . $term . ’%’]); | |
$objectList = []; | |
foreach ($tagListing as $tag) { | |
$taggedObjects = \Pimcore\Model\Element\Tag::getElementsForTag($tag, ‘object’); | |
foreach ($taggedObjects as $taggedObject) { | |
$objectList[$taggedObject->getId()] = $object->getKey(); | |
} | |
} | |
dump($taggedObjects); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment