Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function removeElement($element)
 {
     if (!$this->isValidType($element)) {
         return false;
     }
     return parent::removeElement($element);
 }
 /**
  * {@inheritdoc}
  */
 public function removeElement($element)
 {
     if (!$this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) {
         if ($this->collection->contains($element)) {
             return $this->collection->removeElement($element);
         }
         $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
         if ($persister->removeElement($this, $element)) {
             return $element;
         }
         return null;
     }
     $removed = parent::removeElement($element);
     if (!$removed) {
         return $removed;
     }
     $this->changed();
     if ($this->association !== null && $this->association['type'] & ClassMetadata::TO_MANY && $this->owner && $this->association['orphanRemoval']) {
         $this->em->getUnitOfWork()->scheduleOrphanRemoval($element);
     }
     return $removed;
 }
 /**
  * {@inheritdoc}
  */
 public function removeElement($element)
 {
     $removed = parent::removeElement($element);
     if ($removed) {
         $this->changed();
     }
     return $removed;
 }