__call() публичный Метод

public __call ( $method, $args ) : mixed
$method
$args
Результат mixed
Пример #1
0
 /**
  * @param $name
  * @param $arguments
  * @return array|mixed|null|void
  * @throws \Exception
  */
 public function __call($name, $arguments)
 {
     $sub = substr($name, 0, 14);
     if (substr($name, 0, 16) == "getWithGroupName") {
         $key = substr($name, 16, strlen($name) - 16);
         $groupConfig = Object\KeyValue\GroupConfig::getByName($arguments[0]);
         return $this->getProperty($key, $groupConfig->getId());
     } else {
         if (substr($name, 0, 14) == "getWithGroupId") {
             $key = substr($name, 14, strlen($name) - 14);
             $groupConfig = Object\KeyValue\GroupConfig::getById($arguments[0]);
             return $this->getProperty($key, $groupConfig->getId());
         } else {
             if (substr($name, 0, 3) == "get") {
                 $key = substr($name, 3, strlen($name) - 3);
                 return $this->getProperty($key);
             } else {
                 if (substr($name, 0, 3) == "set") {
                     $key = substr($name, 3, strlen($name) - 3);
                     return $this->setProperty($key, $arguments[0]);
                 }
             }
         }
     }
     return parent::__call($name, $arguments);
 }