Soluble\Datatype
, (*1)
Introduction
Common datatype abstractions, (*2)
Requirements
- PHP engine 5.4+, 7.0 or HHVM >= 3.2.
Documentation
Installation
Installation in your PHP project
Soluble\Datatype works best via composer., (*3)
php composer require soluble/datatype:0.*
Most modern frameworks will include Composer out of the box, but ensure the following file is included:, (*4)
<?php
// include the Composer autoloader
require 'vendor/autoload.php';
API
AbstractColumnDefinition
Metadata information is stored as an Soluble\Datatype\Column\Definition\AbstractColumnDefinition object on which :, (*5)
| General methods |
Return |
Description |
getName() |
string |
Return column name (unaliased) |
getAlias() |
string |
Return column alias |
getTableName() |
string |
Return origin table |
getSchemaName() |
string |
Originating schema for the column/table |
| Type related methods |
Return |
Description |
getDataType() |
string |
Column datatype (see Column\Type) |
getNativeDataType() |
string |
Return native datatype |
isText() |
boolean |
Whether the column is textual (string, blog...) |
isNumeric() |
boolean |
Whether the column is numeric (decimal, int...) |
isDate() |
boolean |
Is a date type |
| Extra information methods |
Return |
Description |
isComputed() |
boolean |
Whether the column is computed, i.e. '1+1, sum() |
isGroup() |
boolean |
Grouped operation sum(), min(), max() |
| Source infos |
Return |
Description |
isPrimary() |
boolean |
Whether the column is (part of) primary key |
isNullable() |
boolean |
Whether the column is nullable |
getColumnDefault() |
string |
Return default value for column |
getOrdinalPosition() |
integer |
Return position in the select |
Implementation od AbstractColumnDefinition
Concrete implementations of Soluble\Datatype\Column\Definition\AbstractColumnDefinition are, (*6)
| Drivers |
Interface |
Description |
BitColumn |
BlobColumn |
BooleanColumn |
DateColumn |
DateColumnInterface |
DateTimeColumn |
DatetimeColumnInterface |
DecimalColumn |
NumericColumnInterface |
FloatColumn |
NumericColumnInterface |
GeometryColumn |
IntegerColumn |
NumericColumnInterface |
StringColumn |
TextColumnInterface |
TimeColumn |
Coding standards