PHP Class atk4\data\Reference_Many

Inheritance: extends Reference
Show file Open project: atk4/data

Public Methods

Method Description
addField ( string $n, array $defaults = [] ) : Field_Callback Adds field as expression to owner model.
addFields ( array $fields = [] ) Adds multiple fields.
ref ( array $defaults = [] ) : Model Returns referenced model with condition set.
refLink ( array $defaults = [] ) : Model Creates model that can be used for generating sub-query actions.

Protected Methods

Method Description
getOurValue ( ) : mixed Returns our field value or id.
referenceOurValue ( ) : Field Returns our field or id field.

Method Details

addField() public method

Used in aggregate strategy.
public addField ( string $n, array $defaults = [] ) : Field_Callback
$n string Field name
$defaults array Properties
return Field_Callback

addFields() public method

Adds multiple fields.
See also: addField()
public addFields ( array $fields = [] )
$fields array Array of fields

getOurValue() protected method

Returns our field value or id.
protected getOurValue ( ) : mixed
return mixed

ref() public method

Returns referenced model with condition set.
public ref ( array $defaults = [] ) : Model
$defaults array Properties
return Model

referenceOurValue() protected method

Returns our field or id field.
protected referenceOurValue ( ) : Field
return Field