Class Phalcon\Db\Column
implements Phalcon\Db\ColumnInterface
Allows to define columns to be used on create or alter table operations
<?php
use Phalcon\Db\Column as Column;
// Column definition
$column = new Column(
"id",
[
"type" => Column::TYPE_INTEGER,
"size" => 10,
"unsigned" => true,
"notNull" => true,
"autoIncrement" => true,
"first" => true,
]
);
// Add column to existing table
$connection->addColumn("robots", null, $column);
Constants
Methods
public getName ()
Column's name
public getSchemaName ()
Schema which table related is
public getType ()
Column data type
public getTypeReference ()
Column data type reference
public getTypeValues ()
Column data type values
public getSize ()
Integer column size
public getScale ()
Integer column number scale
public getDefault ()
Default column value
public __construct (mixed $name, array $definition)
Phalcon\Db\Column constructor
public isUnsigned ()
Returns true if number column is unsigned
public isNotNull ()
Not null
public isPrimary ()
Column is part of the primary key?
public isAutoIncrement ()
Auto-Increment
public isNumeric ()
Check whether column have an numeric type
public isFirst ()
Check whether column have first position in table
public string getAfterPosition ()
Check whether field absolute to position in table
public getBindType ()
Returns the type of bind handling
public static __set_state (array $data)
Restores the internal state of a Phalcon\Db\Column object
public hasDefault ()
Check whether column has default value