1]; $helps = $helpRepo->findAll($params); if ($helps->count() > 0) { return $this->handleHelps($helps); } } /** * @param HelpModel[] $helps * @return array */ protected function handleHelps($helps) { $items = []; foreach ($helps as $help) { $items[] = [ 'id' => $help->id, 'title' => $help->title, 'content' => $help->content, ]; } return $items; } }