public function addTranslationUnit( tao_helpers_translation_TranslationUnit $translationUnit)
    {
        
        // We override the default behaviour because for RDFTranslationFiles, TranslationUnits are
        // unique by concatening the following attributes:
        // - RDFTranslationUnit::subject
        // - RDFTranslationUnit::predicate
        // - RDFTranslationUnit::targetLanguage
        foreach ($this->getTranslationUnits() as $tu) {
        	if ($tu->hasSameTranslationUnitSubject($translationUnit) &&
        		$tu->hasSameTranslationUnitPredicate($translationUnit) &&
        		$tu->hasSameTranslationUnitTargetLanguage($translationUnit)) {
					// This TU already exists. We change its target if the new one
					// has one.
					if ($translationUnit->getTarget() != $translationUnit->getSource()){
					    $tu->setTarget($translationUnit->getTarget());
					}
					return;
				}
        }
		
		// If we are executing this, we can add the TranslationUnit to this TranslationFile.
		$translationUnit->setSourceLanguage($this->getSourceLanguage());
        $translationUnit->setTargetLanguage($this->getTargetLanguage());
        $tus = $this->getTranslationUnits();
		array_push($tus, $translationUnit);
        $this->setTranslationUnits($tus);
        
    }
public function addTranslationUnit( tao_helpers_translation_TranslationUnit $translationUnit)
    {
        
        // We override the default behaviour because for RDFTranslationFiles, TranslationUnits are
        // unique by concatening the following attributes:
        // - RDFTranslationUnit::subject
        // - RDFTranslationUnit::predicate
        // - RDFTranslationUnit::targetLanguage
        foreach ($this->getTranslationUnits() as $tu) {
        	if ($tu->hasSameTranslationUnitSubject($translationUnit) &&
        		$tu->hasSameTranslationUnitPredicate($translationUnit) &&
        		$tu->hasSameTranslationUnitTargetLanguage($translationUnit)) {
					// This TU already exists. We change its target if the new one
					// has one.
					if ($translationUnit->getTarget() != $translationUnit->getSource()){
					    $tu->setTarget($translationUnit->getTarget());
					}
					return;
				}
        }
		
		// If we are executing this, we can add the TranslationUnit to this TranslationFile.
		$translationUnit->setSourceLanguage($this->getSourceLanguage());
        $translationUnit->setTargetLanguage($this->getTargetLanguage());
        $tus = $this->getTranslationUnits();
		array_push($tus, $translationUnit);
        $this->setTranslationUnits($tus);
        
    }
public function addTranslationUnit ( tao_helpers_translation_TranslationUnit $ translationUnit ) { // We override the default behaviour because for RDFTranslationFiles, TranslationUnits are // unique by concatening the following attributes: // - RDFTranslationUnit::subject // - RDFTranslationUnit::predicate // - RDFTranslationUnit::targetLanguage foreach ( $ this -> getTranslationUnits ( ) as $ tu ) { if ( $ tu -> hasSameTranslationUnitSubject ( $ translationUnit ) && $ tu -> hasSameTranslationUnitPredicate ( $ translationUnit ) && $ tu -> hasSameTranslationUnitTargetLanguage ( $ translationUnit ) ) { // This TU already exists. We change its target if the new one // has one. if ( $ translationUnit -> getTarget ( ) != $ translationUnit -> getSource ( ) ) { $ tu -> setTarget ( $ translationUnit -> getTarget ( ) ) ; } return ; } } // If we are executing this, we can add the TranslationUnit to this TranslationFile. $ translationUnit -> setSourceLanguage ( $ this -> getSourceLanguage ( ) ) ; $ translationUnit -> setTargetLanguage ( $ this -> getTargetLanguage ( ) ) ; $ tus = $ this -> getTranslationUnits ( ) ; array_push ( $ tus , $ translationUnit ) ; $ this -> setTranslationUnits ( $ tus ) ; }
Short description of method addTranslationUnit

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@param  TranslationUnit translationUnit
@return mixed
Short description of method addTranslationUnit