FOF30\Model\DataModel\Relation\HasOne::getData PHP Méthode

getData() public méthode

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
Résultat FOF30\Model\DataModel\Collection | FOF30\Model\DataModel
    public function getData($callback = null, Collection $dataCollection = null)
    {
        if (is_null($dataCollection)) {
            return parent::getData($callback, $dataCollection)->first();
        } else {
            return parent::getData($callback, $dataCollection);
        }
    }
HasOne