function getChildren() { $tagIds = current($this->tagMapper->getTagIdsForObjects([$this->objectId], $this->objectType)); if (empty($tagIds)) { return []; } $tags = $this->tagManager->getTagsByIds($tagIds); return array_values(array_map(function ($tag) { return $this->makeNode($tag); }, $tags)); }
public function testUnassignNonExistingTagsInArray() { $caught = false; try { $this->tagMapper->unassignTags(1, 'testtype', [100, $this->tag1->getId()]); } catch (TagNotFoundException $e) { $caught = true; } $this->assertTrue($caught, 'Exception thrown'); $tagIdMapping = $this->tagMapper->getTagIdsForObjects([1], 'testtype'); $this->assertEquals([1 => [$this->tag1->getId(), $this->tag2->getId()]], $tagIdMapping, 'None of the tags got unassigned'); }
function getChildren() { $tagIds = current($this->tagMapper->getTagIdsForObjects([$this->objectId], $this->objectType)); if (empty($tagIds)) { return []; } $tags = $this->tagManager->getTagsByIds($tagIds); // filter out non-visible tags $tags = array_filter($tags, function ($tag) { return $this->tagManager->canUserSeeTag($tag, $this->user); }); return array_values(array_map(function ($tag) { return $this->makeNode($tag); }, $tags)); }