setParent() public method

Set parent.
public setParent ( Sulu\Bundle\MediaBundle\Entity\CollectionInterface $parent = null ) : Sulu\Bundle\MediaBundle\Entity\CollectionInterface
$parent Sulu\Bundle\MediaBundle\Entity\CollectionInterface
return Sulu\Bundle\MediaBundle\Entity\CollectionInterface
Beispiel #1
0
 /**
  * @param Collection $parent
  *
  * @return $this
  */
 public function setParent($parent)
 {
     if ($parent !== null) {
         $this->entity->setParent($parent->getEntity());
     } else {
         $this->entity->setParent(null);
     }
     // FIXME remove cache for parent and generate it on the fly
     //       reason: preview images cannot be generated without a service
     $this->parent = $parent;
     return $this;
 }