LazyRecord\Schema\RuntimeColumn::checkTypeConstraint PHP Method

checkTypeConstraint() public method

public checkTypeConstraint ( $value )
    public function checkTypeConstraint($value)
    {
        if ($isa = $this->isa) {
            switch ($isa) {
                case 'str':
                    if (!is_string($value)) {
                        return false;
                    }
                    break;
                case 'int':
                    if (!is_integer($value)) {
                        return false;
                    }
                    break;
                case 'float':
                    if (!is_float($value)) {
                        return false;
                    }
                    break;
                case 'bool':
                    if (!is_bool($value)) {
                        return false;
                    }
                    break;
            }
        }
        return true;
    }