/** * @test */ public function tagsCanBePersisted() { $tag = new Tag('foobar'); $this->tagRepository->add($tag); $this->persistenceManager->persistAll(); $this->persistenceManager->clearState(); $this->assertCount(1, $this->tagRepository->findAll()); $this->assertInstanceOf('TYPO3\\Media\\Domain\\Model\\Tag', $this->tagRepository->findAll()->getFirst()); }
/** * @test */ public function tagsCanBePersisted() { $tag = new Tag('foobar'); $this->tagRepository->add($tag); $this->persistenceManager->persistAll(); $this->persistenceManager->clearState(); $this->assertCount(1, $this->tagRepository->findAll()); $this->assertInstanceOf(Tag::class, $this->tagRepository->findAll()->getFirst()); }
/** * @param NodeInterface|null $node * @param array $arguments * @return \TYPO3\Flow\Persistence\QueryResultInterface */ public function getData(NodeInterface $node = null, array $arguments) { $tagCollection = $this->tagRepository->findAll(); $tags = []; foreach ($tagCollection as $tag) { /** @var \TYPO3\Media\Domain\Model\Tag $tag */ $tags[$this->persistenceManager->getIdentifierByObject($tag)] = $tag; } return $tags; }
/** * @param AssetCollection $assetCollection * @return void */ public function editAssetCollectionAction(AssetCollection $assetCollection) { $this->view->assignMultiple(array('assetCollection' => $assetCollection, 'tags' => $this->tagRepository->findAll())); }