本文整理匯總了PHP中Doctrine\Common\Persistence\ObjectRepository::findByAgreementForDataTables方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectRepository::findByAgreementForDataTables方法的具體用法?PHP ObjectRepository::findByAgreementForDataTables怎麽用?PHP ObjectRepository::findByAgreementForDataTables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\Common\Persistence\ObjectRepository
的用法示例。
在下文中一共展示了ObjectRepository::findByAgreementForDataTables方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get
/**
* Get the list
*
* @return array
*/
public function get()
{
$totalEntities = $this->repository->countTotal();
if (!is_null($this->category)) {
$entities = $this->repository->findAllForDataTablesByCategory($this->search, $this->sortColumn, $this->sortDirection, $this->category);
} elseif (!is_null($this->entityId)) {
$entities = $this->repository->findAllForDataTables($this->search, $this->sortColumn, $this->sortDirection, $this->entityId, $this->locale);
} elseif (!is_null($this->agreementId)) {
$entities = $this->repository->findByAgreementForDataTables($this->search, $this->sortColumn, $this->sortDirection, $this->agreementId);
} elseif (!is_null($this->advertId)) {
$entities = $this->repository->findByAdvertForDataTables($this->search, $this->sortColumn, $this->sortDirection, $this->advertId);
} else {
$entities = $this->repository->findAllForDataTables($this->search, $this->sortColumn, $this->sortDirection, null, $this->locale);
}
$totalFilteredEntities = count($entities->getScalarResult());
// paginate
$entities->setFirstResult($this->offset)->setMaxResults($this->limit);
$data = $entities->getResult();
return array('iTotalRecords' => $totalEntities, 'iTotalDisplayRecords' => $totalFilteredEntities, 'sEcho' => $this->echo, 'aaData' => $data);
}