Ejemplo n.º 1
0
 /**
  * @param  ChildCountry $country The ChildCountry object to remove.
  * @return $this|ChildContinent The current object (for fluent API support)
  */
 public function removeCountry(ChildCountry $country)
 {
     if ($this->getCountries()->contains($country)) {
         $pos = $this->collCountries->search($country);
         $this->collCountries->remove($pos);
         if (null === $this->countriesScheduledForDeletion) {
             $this->countriesScheduledForDeletion = clone $this->collCountries;
             $this->countriesScheduledForDeletion->clear();
         }
         $this->countriesScheduledForDeletion[] = clone $country;
         $country->setContinent(null);
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param  ChildCountry $subordinate The ChildCountry object to remove.
  * @return $this|ChildCountry The current object (for fluent API support)
  */
 public function removeSubordinate(ChildCountry $subordinate)
 {
     if ($this->getSubordinates()->contains($subordinate)) {
         $pos = $this->collSubordinates->search($subordinate);
         $this->collSubordinates->remove($pos);
         if (null === $this->subordinatesScheduledForDeletion) {
             $this->subordinatesScheduledForDeletion = clone $this->collSubordinates;
             $this->subordinatesScheduledForDeletion->clear();
         }
         $this->subordinatesScheduledForDeletion[] = $subordinate;
         $subordinate->setCountryRelatedBySovereignityId(null);
     }
     return $this;
 }