Fix incorrect function call

This commit is contained in:
Toby Zerner 2015-05-03 12:04:57 +09:30
parent c750e32bfd
commit 3c8c50a282

View File

@ -50,7 +50,7 @@ abstract class BaseSerializer extends SerializerAbstract
$data = !is_null($model->$relation) ? $model->$relation : $model->$relation()->first();
} elseif ($many) {
$relationIds = $relation.'_ids';
$data = $model->$relationIds ?: $model->relation()->get(['id'])->fetch('id')->all();
$data = $model->$relationIds ?: $model->$relation()->get(['id'])->fetch('id')->all();
} else {
$relationId = $relation.'_id';
$data = $model->$relationId;