Object relational mapping - Columns - Data types - Boolean.php 527 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2 3 4
The boolean data type represents only two values that can be either 1 or 0.
Do not assume that these data types are stored as integers because some DBMS drivers may implement this
type with single character text fields for a matter of efficiency.
Ternary logic is possible by using null as the third possible value that may be assigned to fields of this type.  
5

hansbrix's avatar
hansbrix committed
6 7 8 9 10 11 12 13

<code type="php">
class Test extends Doctrine_Record {
    public function setTableDefinition() {
        $this->hasColumn('booltest', 'boolean');
    }
}
</code>