Storm\Core\Relational\Table::AddColumn PHP Method

AddColumn() private method

Add a column to the table.
private AddColumn ( Storm\Core\Relational\IColumn $Column )
$Column Storm\Core\Relational\IColumn The column to add
    private function AddColumn(IColumn $Column)
    {
        if ($Column->HasTable()) {
            if (!$Column->GetTable()->Is($this)) {
                throw new InvalidColumnException('The registered column %s is already registered with another table %s.', $Column->GetName(), $Column->GetTable()->GetName());
            }
        }
        $Column->SetTable($this);
        $ColumnName = $Column->GetName();
        $ColumnIdentifier = $Column->GetIdentifier();
        $this->Columns[$ColumnName] = $Column;
        $this->ColumnsByIdentifiers[$ColumnIdentifier] = $Column;
        if ($Column->IsPrimaryKey()) {
            $this->PrimaryKeyColumns[$ColumnName] = $Column;
            $this->PrimaryKeyColumnByIdentifiers[$ColumnIdentifier] = $Column;
        }
    }