PHP Class LazyRecord\Schema\DeclareColumn

Inheritance: extends SQLBuilder\Universal\Syntax\Column, implements LazyRecord\Schema\ColumnAccessorInterface, implements IteratorAggregat\IteratorAggregate
Datei anzeigen Open project: corneltek/lazyrecord Class Usage Examples

Protected Properties

Property Type Description
$attributes array The default attributes for a column. Variables stores in attributes should be serializable.
$locales string[]
$schema the parent schema object.

Public Methods

Method Description
__construct ( DeclareSchema $schema, $name = null, $type = null ) column name (id)
__get ( $name )
__isset ( $name )
__set ( $name, $value )
applyType ( DeclareColumn $column ) : DeclareColumn Apply column type on a column object for setting foreign key.
asRuntimeColumn ( ) : RuntimeColumn Rebless the data into RuntimeColumn object.
compareType ( DeclareColumn $column )
dump ( )
export ( ) : array Export column attributes to an array.
get ( string $name ) Which should be something like getAttribute($name).
getDefaultValue ( $record = null, $args = null )
getIterator ( ) Return an array iterator of extended attributes.
getLabel ( )
getName ( )
getValidValues ( $record = null, $args = null ) For an existing record, we might need the record data to return specified valid values.
index ( $indexName = null, $using = null )
json ( )
localize ( array $locales ) provide localized columns.
name ( $name )
refer ( $schemaClass ) Use referenece from existing relationship.
renderAs ( $renderAs, array $widgetAttributes = [] )
required ( $notNull = true ) When enabled required(), notNull should also be set.
serial ( ) serial type.
toArray ( ) : array Combine column object properties and extended attributes.
validator ( )

Method Details

__construct() public method

column name (id)
public __construct ( DeclareSchema $schema, $name = null, $type = null )
$schema DeclareSchema

__get() public method

public __get ( $name )

__isset() public method

public __isset ( $name )

__set() public method

public __set ( $name, $value )

applyType() public method

Apply column type on a column object for setting foreign key.
public applyType ( DeclareColumn $column ) : DeclareColumn
$column DeclareColumn
return DeclareColumn

asRuntimeColumn() public method

Rebless the data into RuntimeColumn object.
public asRuntimeColumn ( ) : RuntimeColumn
return RuntimeColumn

compareType() public method

public compareType ( DeclareColumn $column )
$column DeclareColumn

dump() public method

public dump ( )

export() public method

Export column attributes to an array.
public export ( ) : array
return array

get() public method

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

getDefaultValue() public method

public getDefaultValue ( $record = null, $args = null )

getIterator() public method

TODO: consider using export() method to combine the column properties.
public getIterator ( )

getLabel() public method

public getLabel ( )

getName() public method

public getName ( )

getValidValues() public method

For an existing record, we might need the record data to return specified valid values.
public getValidValues ( $record = null, $args = null )

index() public method

public index ( $indexName = null, $using = null )

json() public method

public json ( )

localize() public method

provide localized columns.
public localize ( array $locales )
$locales array

name() public method

public name ( $name )

refer() public method

Once the column is refered, the attribute will be changed, unless user override the attribute after this call.
public refer ( $schemaClass )

renderAs() public method

public renderAs ( $renderAs, array $widgetAttributes = [] )
$widgetAttributes array

required() public method

required() method enabled software validation.
public required ( $notNull = true )

serial() public method

for postgresql-only
public serial ( )

toArray() public method

Combine column object properties and extended attributes.
public toArray ( ) : array
return array

validator() public method

public validator ( )

Property Details

$attributes protected_oe property

The default attributes for a column. Variables stores in attributes should be serializable.
protected array $attributes
return array

$locales protected_oe property

protected string[] $locales
return string[]

$schema protected_oe property

the parent schema object.
protected $schema