1 | <?php |
||
19 | class ColumnSchema extends BaseObject |
||
20 | { |
||
21 | /** |
||
22 | * @var string name of this column (without quotes). |
||
23 | */ |
||
24 | public $name; |
||
25 | /** |
||
26 | * @var bool whether this column can be null. |
||
27 | */ |
||
28 | public $allowNull; |
||
29 | /** |
||
30 | * @var string abstract type of this column. Possible abstract types include: |
||
31 | * char, string, text, boolean, smallint, integer, bigint, float, decimal, datetime, |
||
32 | * timestamp, time, date, binary, and money. |
||
33 | */ |
||
34 | public $type; |
||
35 | /** |
||
36 | * @var string the PHP type of this column. Possible PHP types include: |
||
37 | * `string`, `boolean`, `integer`, `double`, `array`. |
||
38 | */ |
||
39 | public $phpType; |
||
40 | /** |
||
41 | * @var string the DB type of this column. Possible DB types vary according to the type of DBMS. |
||
42 | */ |
||
43 | public $dbType; |
||
44 | /** |
||
45 | * @var mixed default value of this column |
||
46 | */ |
||
47 | public $defaultValue; |
||
48 | /** |
||
49 | * @var array enumerable values. This is set only if the column is declared to be an enumerable type. |
||
50 | */ |
||
51 | public $enumValues; |
||
52 | /** |
||
53 | * @var int display size of the column. |
||
54 | */ |
||
55 | public $size; |
||
56 | /** |
||
57 | * @var int precision of the column data, if it is numeric. |
||
58 | */ |
||
59 | public $precision; |
||
60 | /** |
||
61 | * @var int scale of the column data, if it is numeric. |
||
62 | */ |
||
63 | public $scale; |
||
64 | /** |
||
65 | * @var bool whether this column is a primary key |
||
66 | */ |
||
67 | public $isPrimaryKey; |
||
68 | /** |
||
69 | * @var bool whether this column is auto-incremental |
||
70 | */ |
||
71 | public $autoIncrement = false; |
||
72 | /** |
||
73 | * @var bool whether this column is unsigned. This is only meaningful |
||
74 | * when [[type]] is `smallint`, `integer` or `bigint`. |
||
75 | */ |
||
76 | public $unsigned; |
||
77 | /** |
||
78 | * @var string comment of this column. Not all DBMS support this. |
||
79 | */ |
||
80 | public $comment; |
||
81 | |||
82 | |||
83 | /** |
||
84 | * Converts the input value according to [[phpType]] after retrieval from the database. |
||
85 | * If the value is null or an [[Expression]], it will not be converted. |
||
86 | * @param mixed $value input value |
||
87 | * @return mixed converted value |
||
88 | */ |
||
89 | 639 | public function phpTypecast($value) |
|
93 | |||
94 | /** |
||
95 | * Converts the input value according to [[type]] and [[dbType]] for use in a db query. |
||
96 | * If the value is null or an [[Expression]], it will not be converted. |
||
97 | * @param mixed $value input value |
||
98 | * @return mixed converted value. This may also be an array containing the value as the first element |
||
99 | * and the PDO type as the second element. |
||
100 | */ |
||
101 | 366 | public function dbTypecast($value) |
|
107 | |||
108 | /** |
||
109 | * Converts the input value according to [[phpType]] after retrieval from the database. |
||
110 | * If the value is null or an [[Expression]], it will not be converted. |
||
111 | * @param mixed $value input value |
||
112 | * @return mixed converted value |
||
113 | * @since 2.0.3 |
||
114 | */ |
||
115 | 877 | protected function typecast($value) |
|
169 | |||
170 | /** |
||
171 | * @return int[] array of numbers that represent possible PDO parameter types |
||
172 | */ |
||
173 | private function getPdoParamTypes() |
||
177 | } |
||
178 |