Marshalls request data into PHP booleans.

@param mixed $value The value to convert.
@return bool|null Converted value.
540572
public function marshal($value)
    {
        if ($value === null) {
            return null;
        }
        if ($value === 'true') {
            return true;
        }
        if ($value === 'false') {
            return false;
        }
        if (!is_scalar($value)) {
            return null;
        }

        return !empty($value);
    }
1343248
public static function boolval( $value )
    {
        if ( \is_bool( $value ) )
        {
            return $value;
        }

        $_value = \strtolower( (string)$value );

        //	FILTER_VALIDATE_BOOLEAN doesn't catch 'Y' or 'N', so convert to full words...
        if ( 'y' == $_value )
        {
            $_value = 'yes';
        }
        elseif ( 'n' == $_value )
        {
            $_value = 'no';
        }

        return \filter_var( $_value, FILTER_VALIDATE_BOOLEAN );
    }
881943
public function getDatabaseValue($value)
        {
            if (is_bool($value)) {
                if (Core::getDriver() == Core::DRIVER_MYSQL) {
                    return (int) $value;
                } elseif (Core::getDriver() == Core::DRIVER_POSTGRES) {
                    return ($value) ? 'true' : 'false';
                }
            }
            return $value;
        }
654570
public function marshal($value) {
		if ($value === null) {
			return $value;
		}
		if (is_object($value)) {
			return $value;
		}
		return unserialize($value);
	}
628007
public function reverseTransform($value)
    {
        if (null === $value) {
            return false;
        }

        if (!is_bool($value)) {
            throw new UnexpectedTypeException($value, 'Boolean');
        }

        return true === $value ? $this->trueValue : null;
    }
403819
protected function getBooleanCode($value)
    {
        if ($value && ('true' == $value || true === $value)) {
            return '1';
        } else {
            if ('false' == $value || false === $value) {
                return '0';
            }
        }

        return (bool) $value;
    }
920505
protected function _value($value)
    {
        if ($value === null) {
            return 'null';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }

        return (string)$value;
    }
422372
public static function trueFalse($value)
    {
        if ((is_numeric($value) && $value > 0) || strtoupper($value) == 'Y') {
            return 1;
        }

        return filter_var($value, FILTER_VALIDATE_BOOLEAN) ? 1 : 0;
    }
179641
public function checksum($value)
    {
        $checksum = $this->getChecksum();
        if (!empty($checksum)) {
            if (method_exists($this, $checksum)) {
                return call_user_func(array($this, $checksum), $value);
            }
        }

        return false;
    }
1151782
public static function toBool($value)
    {
        if ($value instanceof Countable) {
            return (bool)count($value);
        }

        if (!static::isStringLike($value)) {
            return (bool)$value;
        }

        $string = "$value";

        if (trim($string) == '') {
            return false;
        }

        if (in_array(strtolower($value), ['0', 'false'], true)) {
            return false;
        }

        return (bool)$string;

    }
1085909
protected function _validate_bool($value)
    {
        if (is_bool($value)) {
            return (int)$value;
        }

        $trueValues = ['1', 'true', 'on'];
        $falseValues = ['0', 'false', 'off'];

        $value = strtolower($value);

        if (in_array($value, $trueValues, true)) {
            return 1;
        } elseif (in_array($value, $falseValues, true)) {
            return 0;
        } else {
            return null;
        }
    }
1027836
public function boolNode($value = null, bool $allowSerializeEmpty = false): BoolNode
    {
        return BoolNode::create($value, $allowSerializeEmpty);
    }
1080250
protected function castToInt($value, bool $nullable = true)
    {
        if (null === $value && $nullable) {
            return null;
        }

        return (int) $value;
    }
238472
protected function toBoolean($value)
    {
        if ($value === 1 || $value === 'true') {
            return true;
        }
        if (is_null($value) || $value === 0 || $value === 'false') {
            return false;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toBoolean(reset($value));
        }

        return $value;
    }
198825
private function parseOptionValue($value = null)
    {
        if (\is_bool($value)) {
            $value = $value === true ? 'true' : 'false';
        } elseif (\is_null($value)) {
            $value = 'null';
        } elseif (\is_string($value)) {
            $value = '\''.$value.'\'';
        }
        return $value;
    }
788406
public function request($value)
    {
        if (!isset($this->request[$value])) {
            return false;
        } else {
            return $this->request[$value];
        }
    }
1059229
public function post($value)
    {
        if (!isset($this->post[$value])) {
            return false;
        } else {
            return $this->post[$value];
        }
    }