PHP Class SQLBuilder\Universal\Syntax\Column

See also: http://www.postgresql.org/docs/9.3/interactive/datatype.html MySQL Data Types:
See also: http://dev.mysql.com/doc/refman/5.6/en/data-types.html MySQL Reference reference_definition: REFERENCES tbl_name (index_col_name,...) [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE] [ON DELETE reference_option] [ON UPDATE reference_option] reference_option: RESTRICT | CASCADE | SET NULL | NO ACTION
Inheritance: implements SQLBuilder\ToSqlInterface
Datei anzeigen Open project: c9s/sqlbuilder Class Usage Examples

Public Properties

Property Type Description
$enum is only used when isa = enum
$isa
$name column name
$notNull Null is set to true by default. (I know MySQL set this as default if you don't specify the not null constraint)
$onUpdate right now this is only for timestamp column
$primary primary
$set is only used when isa = set
$type
$unsigned unsigned

Protected Properties

Property Type Description
$attributeTypes array
$attributes array The default attributes for a column.

Public Methods

Method Description
__call ( $method, $args )
__construct ( $name = NULL, $type = NULL, array $extraAttributes = [] )
__get ( $name )
__get_state ( )
__isset ( $name )
__set ( $name, $value )
__set_state ( array $stash )
autoIncrement ( )
bigint ( $length = NULL )
binary ( $length = NULL )
bit ( $length = 1 )
blob ( )
bool ( )
boolean ( )
buildAutoIncrementClause ( BaseDriver $driver )
buildDefaultClause ( BaseDriver $driver )
buildDefinitionSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
buildDefinitionSqlForModify ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
buildEnumClause ( BaseDriver $driver )
buildNullClause ( BaseDriver $driver ) ***** Clause builder *****
buildPgSQLDefinitionSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
buildPrimaryKeyClause ( BaseDriver $driver )
buildSetClause ( BaseDriver $driver )
buildTimeZoneClause ( BaseDriver $driver )
buildTypeClause ( BaseDriver $driver )
buildTypeName ( BaseDriver $driver )
buildUniqueClause ( BaseDriver $driver )
buildUnsignedClause ( BaseDriver $driver )
char ( $length )
date ( ) ********************************************** DateTime related types ***********************************************
datetime ( )
decimal ( $length = NULL, $decimals = NULL )
double ( $length = NULL, $decimals = NULL ) PgSQL supports double, real.
enum ( $a )
float ( $length = NULL, $decimals = NULL )
getAttribute ( string $name ) Which should be something like getAttribute($name)
getName ( )
getType ( )
int ( $length = NULL )
integer ( $length = NULL )
isa ( $isa )
longblob ( )
longtext ( )
mediumInt ( $length = NULL )
mediumblob ( )
mediumtext ( )
name ( $name )
notNull ( )
null ( )
nullDefined ( )
numeric ( $length = NULL, $decimals = NULL )
point ( ) POINT type
primary ( $primary = true )
real ( $length = NULL, $decimals = NULL )
serial ( ) serial type
set ( $a )
setAttribute ( $name, $value )
setAttributeStash ( array $attributes )
setAttributes ( array $attributes )
smallInt ( $length = NULL )
text ( )
time ( $timezone = true )
timestamp ( $timezone = true ) mysql timestamp automatic initialization
timezone ( $bool = true )
tinyInt ( $length = NULL )
tinyblob ( )
toSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
type ( $type )
unsigned ( $unsigned = true )
varchar ( $length )
year ( )

Protected Methods

Method Description
setLengthInfo ( $length, $decimals = NULL ) ******************************************************************* PROTECTED METHODS (internal use) *********************************************************************

Method Details

__call() public method

public __call ( $method, $args )

__construct() public method

public __construct ( $name = NULL, $type = NULL, array $extraAttributes = [] )
$extraAttributes array

__get() public method

public __get ( $name )

__get_state() public method

public __get_state ( )

__isset() public method

public __isset ( $name )

__set() public method

public __set ( $name, $value )

__set_state() public static method

public static __set_state ( array $stash )
$stash array

autoIncrement() public method

public autoIncrement ( )

bigint() public method

public bigint ( $length = NULL )

binary() public method

public binary ( $length = NULL )

bit() public method

public bit ( $length = 1 )

blob() public method

public blob ( )

bool() public method

public bool ( )

boolean() public method

public boolean ( )

buildAutoIncrementClause() public method

public buildAutoIncrementClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildDefaultClause() public method

public buildDefaultClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildDefinitionSql() public method

public buildDefinitionSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
$driver SQLBuilder\Driver\BaseDriver
$args SQLBuilder\ArgumentArray

buildDefinitionSqlForModify() public method

public buildDefinitionSqlForModify ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
$driver SQLBuilder\Driver\BaseDriver
$args SQLBuilder\ArgumentArray

buildEnumClause() public method

public buildEnumClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildNullClause() public method

***** Clause builder *****
public buildNullClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildPgSQLDefinitionSql() public method

public buildPgSQLDefinitionSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
$driver SQLBuilder\Driver\BaseDriver
$args SQLBuilder\ArgumentArray

buildPrimaryKeyClause() public method

public buildPrimaryKeyClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildSetClause() public method

public buildSetClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildTimeZoneClause() public method

public buildTimeZoneClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildTypeClause() public method

public buildTypeClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildTypeName() public method

public buildTypeName ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildUniqueClause() public method

public buildUniqueClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

buildUnsignedClause() public method

public buildUnsignedClause ( BaseDriver $driver )
$driver SQLBuilder\Driver\BaseDriver

char() public method

public char ( $length )

date() public method

********************************************** DateTime related types ***********************************************
public date ( )

datetime() public method

public datetime ( )

decimal() public method

public decimal ( $length = NULL, $decimals = NULL )

double() public method

XXX: support for 'Infinity' '-Infinity' 'NaN'. MySQL supports float, real, double: float(3), float, real, real(10) MySQL permits a nonstandard syntax: FLOAT(M,D) or REAL(M,D) or DOUBLE PRECISION(M,D). Here, “(M,D)” means than values can be stored with up to M digits in total, of which D digits may be after the decimal point. For example, a column defined as FLOAT(7,4) will look like -999.9999 when displayed. MySQL performs rounding when storing values, so if you insert 999.00009 into a FLOAT(7,4) column, the approximate result is 999.0001.
public double ( $length = NULL, $decimals = NULL )

enum() public method

public enum ( $a )

float() public method

public float ( $length = NULL, $decimals = NULL )

getAttribute() public method

Which should be something like getAttribute($name)
public getAttribute ( string $name )
$name string attribute name

getName() public method

public getName ( )

getType() public method

public getType ( )

int() public method

public int ( $length = NULL )

integer() public method

public integer ( $length = NULL )

isa() public method

public isa ( $isa )

longblob() public method

public longblob ( )

longtext() public method

public longtext ( )

mediumInt() public method

public mediumInt ( $length = NULL )

mediumblob() public method

public mediumblob ( )

mediumtext() public method

public mediumtext ( )

name() public method

public name ( $name )

notNull() public method

public notNull ( )

null() public method

public null ( )

nullDefined() public method

public nullDefined ( )

numeric() public method

public numeric ( $length = NULL, $decimals = NULL )

point() public method

POINT type
public point ( )

primary() public method

public primary ( $primary = true )

real() public method

public real ( $length = NULL, $decimals = NULL )

serial() public method

for postgresql-only
public serial ( )

set() public method

public set ( $a )

setAttribute() public method

public setAttribute ( $name, $value )

setAttributeStash() public method

public setAttributeStash ( array $attributes )
$attributes array

setAttributes() public method

public setAttributes ( array $attributes )
$attributes array

setLengthInfo() protected method

******************************************************************* PROTECTED METHODS (internal use) *********************************************************************
protected setLengthInfo ( $length, $decimals = NULL )

smallInt() public method

public smallInt ( $length = NULL )

text() public method

public text ( )

time() public method

public time ( $timezone = true )

timestamp() public method

mysql timestamp automatic initialization
See also: http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html
public timestamp ( $timezone = true )

timezone() public method

public timezone ( $bool = true )

tinyInt() public method

public tinyInt ( $length = NULL )

tinyblob() public method

public tinyblob ( )

toSql() public method

public toSql ( BaseDriver $driver, SQLBuilder\ArgumentArray $args )
$driver SQLBuilder\Driver\BaseDriver
$args SQLBuilder\ArgumentArray

type() public method

public type ( $type )

unsigned() public method

public unsigned ( $unsigned = true )

varchar() public method

public varchar ( $length )

year() public method

public year ( )

Property Details

$attributeTypes protected_oe property

protected array $attributeTypes
return array

$attributes protected_oe property

The default attributes for a column.
protected array $attributes
return array

$enum public_oe property

is only used when isa = enum
public $enum

$isa public_oe property

public $isa

$name public_oe property

column name
public $name

$notNull public_oe property

Null is set to true by default. (I know MySQL set this as default if you don't specify the not null constraint)
public $notNull

$onUpdate public_oe property

right now this is only for timestamp column
public $onUpdate

$primary public_oe property

primary
public $primary

$set public_oe property

is only used when isa = set
public $set

$type public_oe property

public $type

$unsigned public_oe property

unsigned
public $unsigned