public function setTranslation(INabuTranslation $nb_translation)
    {
        if ($this->checkForValidTranslationInstance($nb_translation) &&
            ($nb_translation->isValueNumeric(NABU_LANG_FIELD_ID) || $nb_translation->isValueGUID(NABU_LANG_FIELD_ID))
        ) {
            $nb_translation->setTranslatedObject($this);
            $nb_language_id = $nb_translation->getValue(NABU_LANG_FIELD_ID);
            $this->translations_list->addItem($nb_translation);
            if ($this->translations_removed->containsKey($nb_language_id)) {
                $this->translations_removed->removeItem($nb_language_id);
            }
        }

        return $nb_translation;
    }
public function setTranslation(INabuTranslation $nb_translation)
    {
        if ($this->checkForValidTranslationInstance($nb_translation) &&
            ($nb_translation->isValueNumeric(NABU_LANG_FIELD_ID) || $nb_translation->isValueGUID(NABU_LANG_FIELD_ID))
        ) {
            $nb_translation->setTranslatedObject($this);
            $nb_language_id = $nb_translation->getValue(NABU_LANG_FIELD_ID);
            $this->translations_list->addItem($nb_translation);
            if ($this->translations_removed->containsKey($nb_language_id)) {
                $this->translations_removed->removeItem($nb_language_id);
            }
        }

        return $nb_translation;
    }
public function setTranslation ( INabuTranslation $ nb_translation ) { if ( $ this -> checkForValidTranslationInstance ( $ nb_translation ) && ( $ nb_translation -> isValueNumeric ( NABU_LANG_FIELD_ID ) || $ nb_translation -> isValueGUID ( NABU_LANG_FIELD_ID ) ) ) { $ nb_translation -> setTranslatedObject ( $ this ) ; $ nb_language_id = $ nb_translation -> getValue ( NABU_LANG_FIELD_ID ) ; $ this -> translations_list -> addItem ( $ nb_translation ) ; if ( $ this -> translations_removed -> containsKey ( $ nb_language_id ) ) { $ this -> translations_removed -> removeItem ( $ nb_language_id ) ; } } return $ nb_translation ; }
Add or replace a translation child object that represents the translated fields of this entity
@param INabuTranslation $nb_translation Translation child object to add / replace
@return CNabuDataObject Returns the translation setted.
Add or replace a translation child object that represents the translated fields of this entity