Пример #1
0
 protected function process()
 {
     $info = Helper::map(self::$MAP_INFO, $this->_xml);
     $info['descriptions'] = Helper::map(self::$MAP_DESCRIPTION, $this->_xml);
     $info['category'] = CategoryEnum::toFloat($info['category']);
     $info['images'] = [];
     foreach ($this->_xml->Pictures->Picture as $picture) {
         $info['images'][] = (string) $picture;
     }
     $this->_data = $info;
 }
Пример #2
0
 public function setCategories($categories)
 {
     $this->_categories = [];
     if (!is_array($categories)) {
         $categories = func_get_args();
     }
     foreach ($categories as $c) {
         $this->_categories[] = CategoryEnum::fromFloat($c);
     }
     return $this;
 }