Skip to content
PHP Ecosystem
Explore

ColumnSchema

API reference › yii › db › oci › ColumnSchema

classyii\db\oci\ColumnSchema
Extendsyii\db\ColumnSchema » yii\base\BaseObject
Implementsyii\base\Configurable
Since22.0
Sourceframework/db/oci/ColumnSchema.php

Represents the metadata of a column in an Oracle database table.

PropertyTypeDescriptionDefined by
$allowNullboolWhether this column can be null. Default: false.yii\db\ColumnSchema
$autoIncrementboolWhether this column is auto-incremental Default: false.yii\db\ColumnSchema
$commentstring|nullComment of this column. Default: null.yii\db\ColumnSchema
$dbTypestringThe DB type of this column. Default: ''.yii\db\ColumnSchema
$defaultValuemixedDefault value of this column Default: null.yii\db\ColumnSchema
$enumValuesarray|nullEnumerable values. Default: null.yii\db\ColumnSchema
$isPrimaryKeybool|nullWhether this column is a primary key Default: null.yii\db\ColumnSchema
$namestringName of this column (without quotes). Default: ''.yii\db\ColumnSchema
$phpTypestringThe PHP type of this column. Default: ''.yii\db\ColumnSchema
$precisionint|nullPrecision of the column data, if it is numeric. Default: null.yii\db\ColumnSchema
$scaleint|nullScale of the column data, if it is numeric. Default: null.yii\db\ColumnSchema
$sizeint|nullDisplay size of the column. Default: null.yii\db\ColumnSchema
$typestringAbstract type of this column. Default: ''.yii\db\ColumnSchema
$unsignedboolWhether this column is unsigned. Default: false.yii\db\ColumnSchema
MethodDescriptionDefined by
__construct()Constructor.yii\base\BaseObject
__call()Calls the named method which is not a class method.yii\base\BaseObject
__get()Returns the value of an object property.yii\base\BaseObject
__isset()Checks if a property is set, i.e. defined and not null.yii\base\BaseObject
__set()Sets value of an object property.yii\base\BaseObject
__unset()Sets an object property to null.yii\base\BaseObject
canGetProperty()Returns a value indicating whether a property can be read.yii\base\BaseObject
canSetProperty()Returns a value indicating whether a property can be set.yii\base\BaseObject
className() staticReturns the fully qualified name of this class.yii\base\BaseObject
dbTypecast()Converts the input value according to $type and $dbType for use in a db query.ColumnSchema
defaultPhpTypecast()Converts an Oracle column default value to its PHP representation.ColumnSchema
hasMethod()Returns a value indicating whether a method is defined.yii\base\BaseObject
hasProperty()Returns a value indicating whether a property is defined.yii\base\BaseObject
init()Initializes the object.yii\base\BaseObject
isType()Returns whether this column uses the given abstract type.yii\db\ColumnSchema
phpTypecast()Converts the input value according to $phpType after retrieval from the database.yii\db\ColumnSchema
typecast() protectedConverts the input value according to $phpType after retrieval from the database.yii\db\ColumnSchema
public function dbTypecast(mixed $value): mixed

Converts the input value according to $type and $dbType for use in a db query.

Converts strings and streams for Oracle BLOB columns to locator-bound values.

If the value is null or an Expression, it will not be converted.

Parameters

ParameterTypeDescription
$valuemixedInput value

Returns

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 defaultPhpTypecast(mixed $value): mixed

Converts an Oracle column default value to its PHP representation.

Handles Oracle-specific default formats:

  • null, empty/whitespace strings, and bare or parenthesized NULL to null.
  • regular and national string literals ('value' / N'value') to their unquoted value, resolving doubled single quotes ('' to '). Oracle treats an empty string literal as null.
  • signed, decimal, scientific, BINARY_FLOAT, and BINARY_DOUBLE numeric literals through ColumnSchema::phpTypecast().
  • everything else to an executable Expression, including datetime literals, function calls, operator expressions, alternative-quoted strings, and sequence NEXTVAL defaults.

Parameters

ParameterTypeDescription
$valuemixedDefault value in Oracle DATA_DEFAULT format.

Returns

mixed: Converted value.

Since

22.0