properties =& $properties; } /** * Get entity field/property * * @param string $name * @return mixed */ function __get($name) { if ( ! isset($this->properties[$name])) { $this->load($name); } return $this->properties[$name]; } // abstract private relation($name); // abstract private __get__(); /** * Set entity field/property * * @param string $name * @param mixed $value * @return void */ function __set($name, $value) { $this->properties[$name] = $value; } function __isset($name) { return isset($this->properties[$name]); } function __unset($name) { unset($this->properties[$name]); } function jsonSerialize() { return $this->properties; } abstract function load(...$args); }