Exemplo n.º 1
0
 /**
  * @param Folder $folder
  *
  * @return string
  */
 public function addChildren(Folder $folder)
 {
     $ids = '';
     foreach ($folder->getChildren() as $child) {
         $ids .= ' and folder.id != ' . $child->getId();
         $ids .= $this->addChildren($child);
     }
     return $ids;
 }
Exemplo n.º 2
0
 /**
  * @param Folder $folder
  */
 public function deleteChildren(Folder $folder)
 {
     $em = $this->getEntityManager();
     foreach ($folder->getChildren() as $child) {
         $this->deleteMedia($child, $em);
         $this->deleteChildren($child, $em);
         $child->setDeleted(true);
         $em->persist($child);
     }
 }