namespace \webfiori\database\mssql
class MSSQLColumn
Class Methods Summary
Class Methods Details
Parameters:
Parameters:
- mixed $val The value that will be cleaned.
Parameters:
- array $options An associative array of options. The available options are:
- name: Required. The name of the column in the database. If not provided, no object will be created.
- datatype: The datatype of the column. If not provided, 'varchar' will be used. Equal option: 'type'.
- size: Size of the column (if datatype does support size). If not provided, 1 will be used.
- default: A default value for the column if its value is not present in case of insert.
- is-null: A boolean. If the column allows null values, this should be set to true. Default is false.
- is-primary: A boolean. It must be set to true if the column represents a primary key. Note that the column will be set as unique once its set as a primary. Equal option: primary.
- is-unique: A boolean. If set to true, a unique index will be created for the column.
- auto-update: A boolean. If the column datatype is 'date', 'time' or 'datetime2' and this parameter is set to true, the time of update will change automatically without having to change it manually.
- scale: Number of numbers to the left of the decimal point. Only supported for decimal datatype.
- comment: A comment which can be used to describe the column.
- validator: A PHP function which can be used to validate user values before submitting the query to database.
Parameters:
- boolean $bool If true is passed, then the value of the column will be updated in case an update query is constructed.
Parameters:
- mixed $default The default value which will be set.
Parameters:
- int $val Number of numbers after the decimal point. It must be a positive number.
- Datatype of the column is not decimal, float or double.
- Size of the column is 0.
- Given scale value is greater than the size of the column.