예제 #1
0
 /**
  * copy the relevant properties of the entity passed into
  * the enveloped entity
  *
  * @param EntityInterface $template
  *
  * @return self
  */
 public function copy(EntityInterface $template)
 {
     if ($this->hasDependencies()) {
         $entity = $this->entity;
         $entity->setIdentity($template->getIdentity())->setStatus($template->getStatus());
         /*
          * if the subject has been removed but the copy is not removed
          */
         if ($entity->getRemoved() != null && $template->getRemoved() == null) {
             $entity->clearRemoved();
         }
     }
     return $this;
 }
예제 #2
0
 /**
  * @return self
  */
 public function clearRemoved()
 {
     if ($this->hasDependencies()) {
         $this->entity->clearRemoved();
     }
     return $this;
 }