/**
* Serializes a data provider.
* @param DataProviderInterface $dataProvider
* @return array the array representation of the data provider.
*/
protected function serializeDataProvider($dataProvider)
{
$models = $this->serializeModels($dataProvider->getModels());
if ($dataProvider->getPagination() === false) {
return $models;
} else {
return ['total' => $dataProvider->getTotalCount(), 'rows' => $models];
}
}