Doctrine\ODM\OrientDB\Caster\Caster::castBoolean PHP Метод

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

Casts the given $value to boolean or tries to guess if it's an implicit boolean value, like the string 'true'.
public castBoolean ( ) : boolean
Результат boolean
    public function castBoolean()
    {
        if (is_bool($this->value)) {
            return $this->value;
        }
        foreach ($this->trueValues as $true) {
            if ($this->value === $true) {
                return true;
            }
        }
        foreach ($this->falseValues as $false) {
            if ($this->value === $false) {
                return false;
            }
        }
        $castFunction = function ($value) {
            return (bool) $value;
        };
        return $this->handleMismatch($castFunction, 'boolean');
    }