lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
private function convertSingleBooleanValue($value, $callback)
    {
        if ($value === null) {
            return $callback(null);
        }

        if (is_bool($value) || is_numeric($value)) {
            return $callback((bool) $value);
        }

        if (! is_string($value)) {
            return $callback(true);
        }

        /**
         * Better safe than sorry: http://php.net/in_array#106319
         */
        if (in_array(strtolower(trim($value)), $this->booleanLiterals['false'], true)) {
            return $callback(false);
        }

        if (in_array(strtolower(trim($value)), $this->booleanLiterals['true'], true)) {
            return $callback(true);
        }

        throw new UnexpectedValueException("Unrecognized boolean literal '${value}'");
    }
private function convertSingleBooleanValue($value, $callback)
    {
        if ($value === null) {
            return $callback(null);
        }

        if (is_bool($value) || is_numeric($value)) {
            return $callback((bool) $value);
        }

        if (! is_string($value)) {
            return $callback(true);
        }

        /**
         * Better safe than sorry: http://php.net/in_array#106319
         */
        if (in_array(strtolower(trim($value)), $this->booleanLiterals['false'], true)) {
            return $callback(false);
        }

        if (in_array(strtolower(trim($value)), $this->booleanLiterals['true'], true)) {
            return $callback(true);
        }

        throw new UnexpectedValueException("Unrecognized boolean literal '${value}'");
    }
private function convertSingleBooleanValue ( $ value , $ callback ) { if ( $ value === null ) { return $ callback ( null ) ; } if ( is_bool ( $ value ) || is_numeric ( $ value ) ) { return $ callback ( ( bool ) $ value ) ; } if ( ! is_string ( $ value ) ) { return $ callback ( true ) ; } /**
         * Better safe than sorry: http://php.net/in_array#106319
         */ if ( in_array ( strtolower ( trim ( $ value ) ) , $ this -> booleanLiterals [ 'false' ] , true ) ) { return $ callback ( false ) ; } if ( in_array ( strtolower ( trim ( $ value ) ) , $ this -> booleanLiterals [ 'true' ] , true ) ) { return $ callback ( true ) ; } throw new UnexpectedValueException ( "Unrecognized boolean literal '${value}'" ) ; }
Converts a single boolean value.

First converts the value to its native PHP boolean type
and passes it to the given callback function to be reconverted
into any custom representation.

@param mixed    $value    The value to convert.
@param callable $callback The callback function to use for converting the real boolean value.

@return mixed

@throws UnexpectedValueException
Converts a single boolean value .