企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Class Phalcon\\Db\\Column # Class **Phalcon\\Db\\Column** *implements*[*Phalcon\\Db\\ColumnInterface*](#) Allows to define columns to be used on create or alter table operations ``` <pre class="calibre14">``` <?php use Phalcon\Db\Column as Column; //column definition $column = new Column("id", array( "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 *integer***TYPE\_INTEGER** *integer***TYPE\_DATE** *integer***TYPE\_VARCHAR** *integer***TYPE\_DECIMAL** *integer***TYPE\_DATETIME** *integer***TYPE\_CHAR** *integer***TYPE\_TEXT** *integer***TYPE\_FLOAT** *integer***TYPE\_BOOLEAN** *integer***TYPE\_DOUBLE** *integer***TYPE\_TINYBLOB** *integer***TYPE\_BLOB** *integer***TYPE\_MEDIUMBLOB** *integer***TYPE\_LONGBLOB** *integer***TYPE\_BIGINTEGER** *integer***TYPE\_JSON** *integer***TYPE\_JSONB** *integer***BIND\_PARAM\_NULL** *integer***BIND\_PARAM\_INT** *integer***BIND\_PARAM\_STR** *integer***BIND\_PARAM\_BLOB** *integer***BIND\_PARAM\_BOOL** *integer***BIND\_PARAM\_DECIMAL** *integer***BIND\_SKIP** ### 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** (*unknown* $name, *unknown* $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** (*unknown* $data) Restores the internal state of a Phalcon\\Db\\Column object | - [索引](# "总目录") - [下一页](# "Abstract class Phalcon\Db\Dialect") | - [上一页](# "Class Phalcon\Db\Adapter\Pdo\Sqlite") | - [API Indice](#) »