ColumnSchema
API reference › yii › db › oci › ColumnSchema
Represents the metadata of a column in an Oracle database table.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$allowNull | bool | Whether this column can be null. Default: false. | yii\ |
$autoIncrement | bool | Whether this column is auto-incremental Default: false. | yii\ |
$comment | string| | Comment of this column. Default: null. | yii\ |
$dbType | string | The DB type of this column. Default: ''. | yii\ |
$defaultValue | mixed | Default value of this column Default: null. | yii\ |
$enumValues | array| | Enumerable values. Default: null. | yii\ |
$isPrimaryKey | bool| | Whether this column is a primary key Default: null. | yii\ |
$name | string | Name of this column (without quotes). Default: ''. | yii\ |
$phpType | string | The PHP type of this column. Default: ''. | yii\ |
$precision | int| | Precision of the column data, if it is numeric. Default: null. | yii\ |
$scale | int| | Scale of the column data, if it is numeric. Default: null. | yii\ |
$size | int| | Display size of the column. Default: null. | yii\ |
$type | string | Abstract type of this column. Default: ''. | yii\ |
$unsigned | bool | Whether this column is unsigned. Default: false. | yii\ |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Constructor. | yii\ |
__call() | Calls the named method which is not a class method. | yii\ |
__get() | Returns the value of an object property. | yii\ |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\ |
__set() | Sets value of an object property. | yii\ |
__unset() | Sets an object property to null. | yii\ |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\ |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\ |
className() static | Returns the fully qualified name of this class. | yii\ |
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\ |
hasProperty() | Returns a value indicating whether a property is defined. | yii\ |
init() | Initializes the object. | yii\ |
isType() | Returns whether this column uses the given abstract type. | yii\ |
phpTypecast() | Converts the input value according to $phpType after retrieval from the database. | yii\ |
typecast() protected | Converts the input value according to $phpType after retrieval from the database. | yii\ |
Method details
Section titled “Method details”dbTypecast()
Section titled “dbTypecast() ”public function dbTypecast(mixed $value): mixedConverts 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
| Parameter | Type | Description |
|---|---|---|
$value | mixed | Input 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.
defaultPhpTypecast()
Section titled “defaultPhpTypecast() ”public function defaultPhpTypecast(mixed $value): mixedConverts an Oracle column default value to its PHP representation.
Handles Oracle-specific default formats:
null, empty/whitespace strings, and bare or parenthesizedNULLtonull.- regular and national string literals (
'value'/N'value') to their unquoted value, resolving doubled single quotes (''to'). Oracle treats an empty string literal asnull. - signed, decimal, scientific,
BINARY_FLOAT, andBINARY_DOUBLEnumeric literals throughColumnSchema::phpTypecast(). - everything else to an executable
Expression, including datetime literals, function calls, operator expressions, alternative-quoted strings, and sequenceNEXTVALdefaults.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed | Default value in Oracle DATA_DEFAULT format. |
Returns
mixed: Converted value.
Since
22.0