/** * @param RecordsGetterWrapperAbstract $wrapper * @param $moduleCode * * @return mixed */ public function setupSearchRecordsWithPaginator(RecordsGetterWrapperAbstract $wrapper, $moduleCode) { $records = $wrapper->setupRecords(); if (count($records)) { $this->searchRecords[$moduleCode] = $records; $this->searchRecords[$moduleCode . '-count'] = $wrapper->getPaginator()->getTotalItemCount(); } return $this->searchRecords; }
public function testSetEntityManager() { $this->recordsGetterWrapperAbstract->setEntityManager($this->getEntityManagerMock()); $this->assertInstanceOf('Doctrine\\ORM\\EntityManager', $this->recordsGetterWrapperAbstract->getEntityManager()); }
/** * Recover a wrapper with paginator set * * @param \ModelModule\Model\RecordsGetterWrapperAbstract $wrapper * @param array $input * @param int $page * @param int $perPage * @return \ModelModule\Model\RecordsGetterWrapperAbstract */ public function recoverWrapperRecordsPaginator($wrapper, $input, $page, $perPage = null) { $wrapper->setInput($input); $wrapper->setupQueryBuilder(); $wrapper->setupPaginator($wrapper->setupQuery($wrapper->getObjectGetter()->getEntityManager())); $wrapper->setupPaginatorCurrentPage($page); $wrapper->setupPaginatorItemsPerPage($perPage); return $wrapper; }