attributes() as $attrName => $attrValue) { $data[$attrName] = (string)$attrValue; } return new static($data); } public function __construct($data, $version = self::SERIAL_VERSION) { $this->data = $data; } public function get($attribute) { return isset($this->data[$attribute]) ? $this->data[$attribute] : null; } public function getAttributes() { return array_keys($this->data); } public function getActions() { $actions = []; foreach ($this->data as $key => $value) { if (!in_array($key, ['rootNode', 'searchNode', 'dataUrl', 'className', 'name'])) { $actions[$key] = $value; } } return $actions; } public function getName() { return $this->data['name']; } public function __toPhpCode() { return "new " . __CLASS__ . "(" . \common_Utils::toPHPVariableString($this->data) . ',' . \common_Utils::toPHPVariableString(self::SERIAL_VERSION) . ")"; } }