/** * @param array $array * * @return $this */ public function buildFromArray(array $array) { $class = get_class($this); $primary = $this->arFieldList->getPrimaryFieldName(); $primary_value = $array[$primary]; if ($primary_value and arObjectCache::isCached($class, $primary_value)) { return arObjectCache::get($class, $primary_value); } foreach ($array as $field_name => $value) { if ($this->wakeUp($field_name, $value) === NULL) { $this->{$field_name} = $value; } else { $this->{$field_name} = $this->wakeUp($field_name, $value); } } arObjectCache::store($this); $this->afterObjectLoad(); return $this; }