/var/www/vhosts/nabawater/vendor/yiisoft/yii2/db
NameSizeModeActions
conditions/-0755rm
cubrid/-0755rm
mssql/-0755rm
mysql/-0755rm
oci/-0755rm
pgsql/-0755rm
sqlite/-0755rm
ActiveQuery.php315060644editdlrm
ActiveQueryInterface.php45420644editdlrm
ActiveQueryTrait.php63150644editdlrm
ActiveRecord.php297890644editdlrm
ActiveRecordInterface.php212070644editdlrm
ActiveRelationTrait.php232920644editdlrm
AfterSaveEvent.php5530644editdlrm
ArrayExpression.php54000644editdlrm
BaseActiveRecord.php695380644editdlrm
BatchQueryResult.php49050644editdlrm
CheckConstraint.php4580644editdlrm
ColumnSchema.php53560644editdlrm
ColumnSchemaBuilder.php132870644editdlrm
Command.php520260644editdlrm
Connection.php453760644editdlrm
Constraint.php5660644editdlrm
ConstraintFinderInterface.php64540644editdlrm
ConstraintFinderTrait.php112040644editdlrm
DataReader.php85180644editdlrm
DefaultValueConstraint.php4720644editdlrm
Exception.php14570644editdlrm
Expression.php19090644editdlrm
ExpressionBuilder.php7410644editdlrm
ExpressionBuilderInterface.php8600644editdlrm
ExpressionBuilderTrait.php7070644editdlrm
ExpressionInterface.php6150644editdlrm
ForeignKeyConstraint.php9370644editdlrm
IndexConstraint.php5530644editdlrm
IntegrityException.php5460644editdlrm
JsonExpression.php26840644editdlrm
Migration.php269330644editdlrm
MigrationInterface.php12260644editdlrm
PdoValue.php13700644editdlrm
PdoValueBuilder.php6920644editdlrm
Query.php495200644editdlrm
QueryBuilder.php742400644editdlrm
QueryExpressionBuilder.php10440644editdlrm
QueryInterface.php128200644editdlrm
QueryTrait.php151550644editdlrm
Schema.php313770644editdlrm
SchemaBuilderTrait.php114950644editdlrm
SqlToken.php96760644editdlrm
SqlTokenizer.php142080644editdlrm
StaleObjectException.php4470644editdlrm
TableSchema.php31290644editdlrm
Transaction.php93650644editdlrm
ViewFinderTrait.php16140644editdlrm
Edit: /var/www/vhosts/nabawater/vendor/yiisoft/yii2/db/ColumnSchema.php (5356B)
* @since 2.0 */ class ColumnSchema extends BaseObject { /** * @var string name of this column (without quotes). */ public $name; /** * @var bool whether this column can be null. */ public $allowNull; /** * @var string abstract type of this column. Possible abstract types include: * char, string, text, boolean, smallint, integer, bigint, float, decimal, datetime, * timestamp, time, date, binary, and money. */ public $type; /** * @var string the PHP type of this column. Possible PHP types include: * `string`, `boolean`, `integer`, `double`, `array`. */ public $phpType; /** * @var string the DB type of this column. Possible DB types vary according to the type of DBMS. */ public $dbType; /** * @var mixed default value of this column */ public $defaultValue; /** * @var array enumerable values. This is set only if the column is declared to be an enumerable type. */ public $enumValues; /** * @var int display size of the column. */ public $size; /** * @var int precision of the column data, if it is numeric. */ public $precision; /** * @var int scale of the column data, if it is numeric. */ public $scale; /** * @var bool whether this column is a primary key */ public $isPrimaryKey; /** * @var bool whether this column is auto-incremental */ public $autoIncrement = false; /** * @var bool whether this column is unsigned. This is only meaningful * when [[type]] is `smallint`, `integer` or `bigint`. */ public $unsigned; /** * @var string comment of this column. Not all DBMS support this. */ public $comment; /** * Converts the input value according to [[phpType]] after retrieval from the database. * If the value is null or an [[Expression]], it will not be converted. * @param mixed $value input value * @return mixed converted value */ public function phpTypecast($value) { return $this->typecast($value); } /** * Converts the input value according to [[type]] and [[dbType]] for use in a db query. * If the value is null or an [[Expression]], it will not be converted. * @param mixed $value input value * @return mixed converted value. This may also be an array containing the value as the first element * and the PDO type as the second element. */ public function dbTypecast($value) { // the default implementation does the same as casting for PHP, but it should be possible // to override this with annotation of explicit PDO type. return $this->typecast($value); } /** * Converts the input value according to [[phpType]] after retrieval from the database. * If the value is null or an [[Expression]], it will not be converted. * @param mixed $value input value * @return mixed converted value * @since 2.0.3 */ protected function typecast($value) { if ($value === '' && !in_array( $this->type, [ Schema::TYPE_TEXT, Schema::TYPE_STRING, Schema::TYPE_BINARY, Schema::TYPE_CHAR ], true) ) { return null; } if ($value === null || gettype($value) === $this->phpType || $value instanceof ExpressionInterface || $value instanceof Query ) { return $value; } if (is_array($value) && count($value) === 2 && isset($value[1]) && in_array($value[1], $this->getPdoParamTypes(), true) ) { return new PdoValue($value[0], $value[1]); } switch ($this->phpType) { case 'resource': case 'string': if (is_resource($value)) { return $value; } if (is_float($value)) { // ensure type cast always has . as decimal separator in all locales return StringHelper::floatToString($value); } return (string) $value; case 'integer': return (int) $value; case 'boolean': // treating a 0 bit value as false too // https://github.com/yiisoft/yii2/issues/9006 return (bool) $value && $value !== "\0"; case 'double': return (float) $value; } return $value; } /** * @return int[] array of numbers that represent possible PDO parameter types */ private function getPdoParamTypes() { return [\PDO::PARAM_BOOL, \PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_LOB, \PDO::PARAM_NULL, \PDO::PARAM_STMT]; } }