Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save factoryhr/f1fd20cfe460ee38787dc3e0e86d7e7f to your computer and use it in GitHub Desktop.
Save factoryhr/f1fd20cfe460ee38787dc3e0e86d7e7f to your computer and use it in GitHub Desktop.
$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