PHP Класс FOF30\Model\DataModel\Relation\HasOne

For example, parentModel is Users and foreignModel is Phones. Each uses has exactly one Phone.
Наследование: extends HasMany
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getData ( callable $callback = null, Collection $dataCollection = null ) : Collection | DataModel Get the relation data.

Описание методов

getData() публичный Метод

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
Результат FOF30\Model\DataModel\Collection | FOF30\Model\DataModel