00001 <?
00002
00011 class SDRVocabList extends SXMLModel {
00012 private static $ATTRIBUTES = array(
00013 'resultsInfo' => array('type' => 'SDRResultsInfoObj'),
00014 'values' => array('type' => 'string', 'array' => true)
00015 );
00016
00025 public function __construct($xml = null) {
00026 parent::__construct();
00027
00028 $this->registerAttributes(self::$ATTRIBUTES);
00029 $this->registerNodeName('SearchResults');
00030
00031 if($xml)
00032 $this->setXML($xml);
00033 }
00034
00043 protected function setXMLImpl($xml) {
00044 $info = new SDRResultsInfoObj($xml->resultsInfo);
00045 $this->set('resultsInfo', $info);
00046 $values = array();
00047 foreach($xml->values->value as $v)
00048 $values[] = (string)$v;
00049 $this->set('values', $values);
00050 return true;
00051 }
00052
00062 protected function getXMLImpl($root, $forceRegen) {
00063 $xml = "<$root>";
00064 $xml .= $this->get('resultsInfo')->getXML(array('forceRegen' => $forceRegen, 'asString' => true));
00065 $xml .= '<values>';
00066 $values = $this->get('values');
00067 if(count($values) > 0)
00068 $xml .= '<value>' . implode('</value><value>', $values) . '</value>';
00069 $xml .= "</values></$root>";
00070 return $xml;
00071 }
00072 }
00073
00074 ?>