Exemple #1
0
 /**
  * @depends testAddFolderToContent
  */
 public function testRemoveFolder(ContentFolder $association)
 {
     $event = new ContentRemoveFolderEvent($association->getContent(), $association->getFolder()->getId());
     $event->setDispatcher($this->dispatcher);
     $contentAction = new Content($this->getContainer());
     $contentAction->removeFolder($event);
     $testAssociation = ContentFolderQuery::create()->filterByContent($association->getContent())->filterByFolder($association->getFolder())->findOne();
     $this->assertNull($testAssociation);
 }
Exemple #2
0
 public function removeFolder(ContentRemoveFolderEvent $event)
 {
     $contentFolder = ContentFolderQuery::create()->filterByContent($event->getContent())->filterByFolderId($event->getFolderId())->findOne();
     if (null !== $contentFolder) {
         $contentFolder->delete();
     }
 }