* @author Sebastian Ertner * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * @link http://www.temando.com/ */ class Collection extends ApiCollection { /** * @var LocationRepositoryInterface */ private $locationRepository; /** * Collection constructor. * @param EntityFactoryInterface $entityFactory * @param ManagerInterface $messageManager * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param LocationRepositoryInterface $locationRepository */ public function __construct( EntityFactoryInterface $entityFactory, ManagerInterface $messageManager, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, LocationRepositoryInterface $locationRepository ) { $this->locationRepository = $locationRepository; parent::__construct($entityFactory, $messageManager, $filterBuilder, $searchCriteriaBuilder); } /** * @param SearchCriteriaInterface $criteria * @return LocationInterface[] */ public function fetchData(SearchCriteriaInterface $criteria) { $locations = $this->locationRepository->getList( $criteria->getCurrentPage(), $criteria->getPageSize() ); return $locations; } }