![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/Corals/modules/Woo/Integration/WooCommerce/Models/ |
<?php namespace Corals\Modules\Woo\Integration\WooCommerce\Models; /** * Class BaseModel * @package Corals\Modules\Woo\Integration\WooCommerce\Models\ */ class BaseModel { protected $properties = []; /** * Get Inaccessible Property. * * @param string $name * * @return int|string|array|object|null */ public function __get($name) { return $this->$name; } /** * Set Option. * * @param string $name * @param string $value * * @return void */ public function __set($name, $value) { $this->properties[$name] = $value; } public function __call($method, $parameters) { if (!method_exists($this, $method)) { preg_match_all('/((?:^|[A-Z])[a-z]+)/', $method, $partials); $method = array_shift($partials[0]); if (!method_exists($this, $method)) { throw new \Exception('Sorry! you are calling wrong method'); } array_unshift($parameters, strtolower(implode('_', $partials[0]))); } return $this->$method(...$parameters); } public static function __callStatic($method, $parameters) { return (new static())->$method(...$parameters); } }