Exemplo n.º 1
0
 /**
  * @param  ChildLanguage $language The ChildLanguage object to remove.
  * @return $this|ChildLanguageType The current object (for fluent API support)
  */
 public function removeLanguage(ChildLanguage $language)
 {
     if ($this->getLanguages()->contains($language)) {
         $pos = $this->collLanguages->search($language);
         $this->collLanguages->remove($pos);
         if (null === $this->languagesScheduledForDeletion) {
             $this->languagesScheduledForDeletion = clone $this->collLanguages;
             $this->languagesScheduledForDeletion->clear();
         }
         $this->languagesScheduledForDeletion[] = $language;
         $language->setType(null);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * @param  ChildLanguage $sublanguage The ChildLanguage object to remove.
  * @return $this|ChildLanguage The current object (for fluent API support)
  */
 public function removeSublanguage(ChildLanguage $sublanguage)
 {
     if ($this->getSublanguages()->contains($sublanguage)) {
         $pos = $this->collSublanguages->search($sublanguage);
         $this->collSublanguages->remove($pos);
         if (null === $this->sublanguagesScheduledForDeletion) {
             $this->sublanguagesScheduledForDeletion = clone $this->collSublanguages;
             $this->sublanguagesScheduledForDeletion->clear();
         }
         $this->sublanguagesScheduledForDeletion[] = $sublanguage;
         $sublanguage->setParent(null);
     }
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Remove language of this object
  * through the lyric_language cross reference table.
  *
  * @param ChildLanguage $language
  * @return ChildLyric The current object (for fluent API support)
  */
 public function removeLanguage(ChildLanguage $language)
 {
     if ($this->getLanguages()->contains($language)) {
         $lyricLanguage = new LyricLanguage();
         $lyricLanguage->setLanguage($language);
         if ($language->isLyricsLoaded()) {
             //remove the back reference if available
             $language->getLyrics()->removeObject($this);
         }
         $lyricLanguage->setLyric($this);
         $this->removeLyricLanguage(clone $lyricLanguage);
         $lyricLanguage->clear();
         $this->collLanguages->remove($this->collLanguages->search($language));
         if (null === $this->languagesScheduledForDeletion) {
             $this->languagesScheduledForDeletion = clone $this->collLanguages;
             $this->languagesScheduledForDeletion->clear();
         }
         $this->languagesScheduledForDeletion->push($language);
     }
     return $this;
 }