BooleanType.php 621 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
<?php

/**
 * Type that maps an SQL boolean to a PHP boolean.
 *
 */
class Doctrine_DataType_BooleanType extends Doctrine_DataType
{
    /**
     * Enter description here...
     *
     * @param unknown_type $value
     * @override
     */
    public function convertToDatabaseValue($value, Doctrine_DatabasePlatform $platform)
    {
        return $platform->convertBooleans($value);
    }
    
    /**
     * Enter description here...
     *
     * @param unknown_type $value
     * @return unknown
     * @override
     */
    public function convertToObjectValue($value)
    {
        return (bool)$value;
    }
}

?>