Example #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;
 }