/** * Gets all announce entities associated with provided category class * * @param string $class Category class * @return array */ public function getAllByClass($class) { $id = $this->categoryMapper->fetchIdByClass($class); // Do the following query in case right id supplied if ($id) { return $this->announceManager->fetchAllPublishedByCategoryId($id); } else { return array(); } }