PHP Class Field_Reference, atk4

Inheritance: extends Field
Exibir arquivo Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$dereferenced_field string
$display_field string
$model Model
$model_name string
$table_alias string

Public Methods

Method Description
calculateSubQuery ( ) : string
caption ( $x = UNDEFINED )
destroy ( ) Destroy this field and dereferenced field.
getDereferenced ( ) : string Return name of dereferenced field
getModel ( ) : Model Return model of field
ref ( string | boolean | null $mode = null ) : Model ref() will traverse reference and will attempt to load related model's entry. If the entry will fail to load it will return model which would not be loaded. This can be changed by specifying an argument:.
refSQL ( ) : SQL_Model Return DSQL for field
setModel ( Model | string $model, string | boolean $display_field = null ) : Model | $this Set model
sortable ( $x = UNDEFINED )

Method Details

calculateSubQuery() public method

public calculateSubQuery ( ) : string
return string

caption() public method

public caption ( $x = UNDEFINED )

destroy() public method

Destroy this field and dereferenced field.
public destroy ( )

getDereferenced() public method

Return name of dereferenced field
public getDereferenced ( ) : string
return string

getModel() public method

Return model of field
public getModel ( ) : Model
return Model

ref() public method

'model' - simply create new model and return it without loading anything false or 'ignore' - will not even try to load anything null (default) - will tryLoad() 'load' - will always load the model and if record is not present, will fail 'create' - if record fails to load, will create new record, save, get ID and insert into $this 'link' - if record fails to load, will return new record, with appropriate afterSave hander, which will update current model also and save it too.
public ref ( string | boolean | null $mode = null ) : Model
$mode string | boolean | null
return Model

refSQL() public method

Return DSQL for field
public refSQL ( ) : SQL_Model
return SQL_Model

setModel() public method

Set model
public setModel ( Model | string $model, string | boolean $display_field = null ) : Model | $this
$model Model | string
$display_field string | boolean
return Model | $this

sortable() public method

public sortable ( $x = UNDEFINED )

Property Details

$dereferenced_field public_oe property

public string $dereferenced_field
return string

$display_field public_oe property

public string $display_field
return string

$model public_oe property

public Model $model
return Model

$model_name public_oe property

public string $model_name
return string

$table_alias public_oe property

public string $table_alias
return string