Lazer\Classes\Helpers\Validate::type PHP 메소드

type() 공개 메소드

Checking that typed field have correct type of value
public type ( string $name, mixed $value ) : boolean
$name string
$value mixed
리턴 boolean
    public function type($name, $value)
    {
        $schema = Config::table($this->name)->schema();
        if (array_key_exists($name, $schema) && $schema[$name] == gettype($value)) {
            return TRUE;
        }
        throw new LazerException('Wrong data type');
    }