/** * Setter unit * * @param String $unit String * * @return void */ public function setUnit($unit) { if (!$unit) { $this->unit = null; return; } $uni = new CCDA_base_cs(); $uni->setData($unit); $this->unit = $uni; }
/** * Setter currency * * @param String $currency String * * @return void */ public function setCurrency($currency) { if (!$currency) { $this->currency = null; return; } $cs = new CCDA_base_cs(); $cs->setData($currency); $this->currency = $cs; }
/** * Setter ID * * @param String $inst String * * @return void */ function setIdentifier($inst) { if (!$inst) { $this->identifier = null; return; } $cs = new CCDA_base_cs(); $cs->setData($inst); $this->identifier = $cs; }
/** * Setter Code * * @param String $code String * * @return void */ public function setCode($code) { if (!$code) { $this->code = null; return; } $cod = new CCDA_base_cs(); $cod->setData($code); $this->code = $cod; }
/** * Fonction qui teste si la classe est valide * * @return array() */ function test() { $tabTest = parent::test(); /** * Test avec une valeur correcte */ if ($this->_enumeration) { $enum = $this->_enumeration; $this->setData($enum[0]); $tabTest[] = $this->sample("Test avec une valeur correcte", "Document valide"); } /*-------------------------------------------------------------------------------------*/ /** * Test avec une valeur correcte d'un union */ $union = $this->getUnion(); if ($union) { $unionName = "CCDA" . $union[0]; /** @var CCDA_Datatype_Voc $unionClass */ $unionClass = new $unionName(); $unionEnum = $unionClass->getEnumeration(true); if ($unionEnum) { $this->setData($unionEnum[0]); $tabTest[] = $this->sample("Test avec une valeur correcte d'un union", "Document valide"); } } /*-------------------------------------------------------------------------------------*/ return $tabTest; }
/** * Setter mediaType * * @param String $mediaType String * * @return void */ public function setMediaType($mediaType) { if (!$mediaType) { $this->mediaType = null; return; } $media = new CCDA_base_cs(); $media->setData($mediaType); $this->mediaType = $media; }