# DBColumn Class Reference
[Dynamic query builder]

Inheritance diagram for DBColumn:
[legend]

List of all members.

## Public Member Functions

| __construct (DataType $type, $name)
| getType ()
| setTable (DBTable $table)
| getName ()
| getTable ()
| isPrimaryKey ()
| setPrimaryKey ($primary=false)
| setDefault ($default)
| getDefault ()
| setReference (DBColumn $column, $onDelete=null, $onUpdate=null)
| dropReference ()
| hasReference ()
| setAutoincrement ($auto=false)
| isAutoincrement ()
| toDialectString (Dialect $dialect)

## Static Public Member Functions

static | create (DataType $type, $name)

## Private Attributes

| $type = null
| $name = null
| $table = null
| $default = null
| $reference = null
| $onUpdate = null
| $onDelete = null
| $primary = null
| $sequenced = null

## Detailed Description

Definition at line 15 of file DBColumn.class.php.

## Constructor & Destructor Documentation

DBColumn::__construct | ( | DataType $ | type,
|  | $ | name |
| ) |  |  |

Definition at line 39 of file DBColumn.class.php.

References $name.

## Member Function Documentation

static DBColumn::create | ( | DataType $ | type,
|  | $ | name |
| ) |  |  | `[static]`

Returns:
  DBColumn

Definition at line 34 of file DBColumn.class.php.

References $name.

Referenced by MetaClassProperty::buildColumn(), and MySQL::getTableInfo().

DBColumn::dropReference | ( |  | ) |

Returns:
  DBColumn

Definition at line 137 of file DBColumn.class.php.

DBColumn::getDefault | ( |  | ) |

Definition at line 101 of file DBColumn.class.php.

DBColumn::getName | ( |  | ) |

Definition at line 63 of file DBColumn.class.php.

Referenced by DBTable::addColumn().

DBColumn::getTable | ( |  | ) |

Returns:
  DBTable

Implements SQLTableName.

Definition at line 71 of file DBColumn.class.php.

DBColumn::getType | ( |  | ) |

Returns:
  DataType

Definition at line 48 of file DBColumn.class.php.

Referenced by LiteDialect::checkColumn().

DBColumn::hasReference | ( |  | ) |

Definition at line 146 of file DBColumn.class.php.

DBColumn::isAutoincrement | ( |  | ) |

Definition at line 161 of file DBColumn.class.php.

DBColumn::isPrimaryKey | ( |  | ) |

Definition at line 76 of file DBColumn.class.php.

Referenced by LiteDialect::checkColumn().

DBColumn::setAutoincrement | ( | $ | auto = `false` | ) |

Returns:
  DBColumn

Definition at line 154 of file DBColumn.class.php.

DBColumn::setDefault | ( | $ | default | ) |

Returns:
  DBColumn

Definition at line 94 of file DBColumn.class.php.

References $default.

Referenced by MyDialect::preAutoincrement().

DBColumn::setPrimaryKey | ( | $ | primary = `false` | ) |

Returns:
  DBColumn

Definition at line 84 of file DBColumn.class.php.

References $primary.

DBColumn::setReference | ( | DBColumn $ | column,
|  | $ | onDelete = `null`,
|  | $ | onUpdate = `null` |
| ) |  |  |

Exceptions:

  | WrongArgumentException |

Returns:
  DBColumn

Definition at line 110 of file DBColumn.class.php.

References $onDelete, $onUpdate, and Assert::isTrue().

Here is the call graph for this function:

DBColumn::setTable | ( | DBTable $ | table | ) |

Returns:
  DBColumn

Definition at line 56 of file DBColumn.class.php.

Referenced by DBTable::addColumn().

DBColumn::toDialectString | ( | Dialect $ | dialect | ) |

Implements DialectString.

Definition at line 166 of file DBColumn.class.php.

References $default, $table, DataType::BOOLEAN, Dialect::quoteField(), and Dialect::valueToString().

Here is the call graph for this function:

## Member Data Documentation

DBColumn::$default = null`[private]`

Definition at line 21 of file DBColumn.class.php.

Referenced by setDefault(), and toDialectString().

DBColumn::$name = null`[private]`

Definition at line 18 of file DBColumn.class.php.

Referenced by __construct(), and create().

DBColumn::$onDelete = null`[private]`

Definition at line 25 of file DBColumn.class.php.

Referenced by setReference().

DBColumn::$onUpdate = null`[private]`

Definition at line 24 of file DBColumn.class.php.

Referenced by setReference().

DBColumn::$primary = null`[private]`

Definition at line 27 of file DBColumn.class.php.

Referenced by setPrimaryKey().

DBColumn::$reference = null`[private]`

Definition at line 23 of file DBColumn.class.php.

DBColumn::$sequenced = null`[private]`

Definition at line 29 of file DBColumn.class.php.

DBColumn::$table = null`[private]`

Definition at line 20 of file DBColumn.class.php.

Referenced by toDialectString().

DBColumn::$type = null`[private]`

Definition at line 17 of file DBColumn.class.php.

The documentation for this class was generated from the following file:

- core/OSQL/DBColumn.class.php