* @package tao */ class tao_helpers_translation_RDFTranslationUnit extends tao_helpers_translation_TranslationUnit { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- /** * Short description of attribute subject * * @access private * @var string */ private $subject = ''; /** * Short description of attribute predicate * * @access private * @var string */ private $predicate = ''; // --- OPERATIONS --- /** * Short description of method getSubject * * @access public * @author Jerome Bogaerts, * @return string */ public function getSubject() { $returnValue = (string) ''; $returnValue = $this->subject; return (string) $returnValue; } /** * Short description of method getPredicate * * @access public * @author Jerome Bogaerts, * @return string */ public function getPredicate() { $returnValue = (string) ''; $returnValue = $this->predicate; return (string) $returnValue; } /** * Short description of method setSubject * * @access public * @author Jerome Bogaerts, * @param string subject * @return mixed */ public function setSubject($subject) { $this->subject = $subject; $this->addAnnotation('subject', $subject); } /** * Short description of method setPredicate * * @access public * @author Jerome Bogaerts, * @param string predicate * @return mixed */ public function setPredicate($predicate) { $this->predicate = $predicate; $this->addAnnotation('predicate', $predicate); } /** * Checks whether or not a given RDFTranslationUnit has the same subject * value as the current instance. * * @access public * @author Jerome Bogaerts, * @param RDFTranslationUnit translationUnit * @return boolean */ public function hasSameTranslationUnitSubject(tao_helpers_translation_RDFTranslationUnit $translationUnit) { $returnValue = (bool) false; $returnValue = $this->getSubject() == $translationUnit->getSubject(); return (bool) $returnValue; } /** * Checks whether or not a given RDFTranslationUnit has the same predicate * value as the current instance. * * @access public * @author Jerome Bogaerts, * @param RDFTranslationUnit translationUnit * @return boolean */ public function hasSameTranslationUnitPredicate(tao_helpers_translation_RDFTranslationUnit $translationUnit) { $returnValue = (bool) false; $returnValue = $this->getPredicate() == $translationUnit->getPredicate(); return (bool) $returnValue; } /** * Checks wether or not that the current translation unit has the same * than another one. For RDFTranslationUnits, we consider that two * units have the same source if their source, subject, predicate and target * are identical. * * @access public * @author Jerome Bogaerts, * @param TranslationUnit translationUnit A translation unit to compare. * @return boolean */ public function hasSameTranslationUnitSource(tao_helpers_translation_TranslationUnit $translationUnit) { $returnValue = (bool) false; $returnValue = $this->hasSameTranslationUnitPredicate($translationUnit) && $this->hasSameTranslationUnitSubject($translationUnit) && $this->hasSameTranslationUnitTargetLanguage($translationUnit); return (bool) $returnValue; } /** * Short description of method setSource * * @access public * @author Jerome Bogaerts, * @param string source * @return mixed */ public function setSource($source) { parent::setSource($source); $this->addAnnotation('source', $source) ; } }