PHP Class FOF30\Model\DataModel\Relation\HasOne

For example, parentModel is Users and foreignModel is Phones. Each uses has exactly one Phone.
Inheritance: extends HasMany
Mostrar archivo Open project: akeeba/fof Class Usage Examples

Public Methods

Method Description
getData ( callable $callback = null, Collection $dataCollection = null ) : Collection | DataModel Get the relation data.

Method Details

getData() public method

If you want to apply additional filtering to the foreign model, use the $callback. It can be any function, static method, public method or closure with an interface of function(DataModel $foreignModel). You are not supposed to return anything, just modify $foreignModel's state directly. For example, you may want to do: $foreignModel->setState('foo', 'bar')
public getData ( callable $callback = null, Collection $dataCollection = null ) : Collection | DataModel
$callback callable The callback to run on the remote model.
$dataCollection FOF30\Model\DataModel\Collection
return FOF30\Model\DataModel\Collection | FOF30\Model\DataModel