Illuminate\Database\Eloquent\Model::__callStatic PHP 메소드

__callStatic() 공개 정적인 메소드

Handle dynamic static method calls into the method.
public static __callStatic ( string $method, array $parameters ) : mixed
$method string
$parameters array
리턴 mixed
    public static function __callStatic($method, $parameters)
    {
        $instance = new static();
        return call_user_func_array([$instance, $method], $parameters);
    }

Usage Example

예제 #1
0
 public static function __callStatic($method, $parameters)
 {
     static $cachedRoles = null;
     if (is_null($cachedRoles)) {
         $cachedRoles = array_values(\Config::get('role.roles'));
     }
     if (in_array($method, $cachedRoles)) {
         return self::findByName($method);
     }
     return parent::__callStatic($method, $parameters);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::__callStatic
Model