Exemplo n.º 1
0
 /**
  * Initializes this CommonAttributes from an associative array
  *
  * @param array $o
  */
 public function initFromArray($o)
 {
     if (isset($o['base'])) {
         $this->base = $o["base"];
         unset($o["base"]);
     }
     if (isset($o['lang'])) {
         $this->lang = $o["lang"];
         unset($o["lang"]);
     }
     if (!empty($o)) {
         foreach ($o as $key => $array) {
             $class = JsonMapper::getClassName($key);
             if ($class != null) {
                 foreach ($array as $ci) {
                     $this->extensionElements[] = new $class($ci);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Initializes this ExtensibleData from an associative array
  *
  * @param array $o
  */
 public function initFromArray(array $o)
 {
     if (isset($o['id'])) {
         $this->id = $o["id"];
         unset($o['id']);
     }
     if (!empty($o)) {
         foreach ($o as $key => $data) {
             $class = JsonMapper::getClassName($key);
             if ($class != null) {
                 $this->extensionElements[] = new $class($data);
             }
         }
     }
 }