/** * @param ChildLocalization $localization The ChildLocalization object to remove. * @return $this|ChildLanguageScript The current object (for fluent API support) */ public function removeLocalization(ChildLocalization $localization) { if ($this->getLocalizations()->contains($localization)) { $pos = $this->collLocalizations->search($localization); $this->collLocalizations->remove($pos); if (null === $this->localizationsScheduledForDeletion) { $this->localizationsScheduledForDeletion = clone $this->collLocalizations; $this->localizationsScheduledForDeletion->clear(); } $this->localizationsScheduledForDeletion[] = $localization; $localization->setScript(null); } return $this; }
/** * Remove localization of this object * through the kk_localization_variant cross reference table. * * @param ChildLocalization $localization * @return ChildLanguageVariant The current object (for fluent API support) */ public function removeLocalization(ChildLocalization $localization) { if ($this->getLocalizations()->contains($localization)) { $localizationVariant = new ChildLocalizationVariant(); $localizationVariant->setLocalization($localization); if ($localization->isLanguageVariantsLoaded()) { //remove the back reference if available $localization->getLanguageVariants()->removeObject($this); } $localizationVariant->setLanguageVariant($this); $this->removeLocalizationVariant(clone $localizationVariant); $localizationVariant->clear(); $this->collLocalizations->remove($this->collLocalizations->search($localization)); if (null === $this->localizationsScheduledForDeletion) { $this->localizationsScheduledForDeletion = clone $this->collLocalizations; $this->localizationsScheduledForDeletion->clear(); } $this->localizationsScheduledForDeletion->push($localization); } return $this; }
/** * @param ChildLocalization $localizationRelatedById The ChildLocalization object to remove. * @return $this|ChildLocalization The current object (for fluent API support) */ public function removeLocalizationRelatedById(ChildLocalization $localizationRelatedById) { if ($this->getLocalizationsRelatedById()->contains($localizationRelatedById)) { $pos = $this->collLocalizationsRelatedById->search($localizationRelatedById); $this->collLocalizationsRelatedById->remove($pos); if (null === $this->localizationsRelatedByIdScheduledForDeletion) { $this->localizationsRelatedByIdScheduledForDeletion = clone $this->collLocalizationsRelatedById; $this->localizationsRelatedByIdScheduledForDeletion->clear(); } $this->localizationsRelatedByIdScheduledForDeletion[] = $localizationRelatedById; $localizationRelatedById->setParent(null); } return $this; }