mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
crudification + corrections on thirdparty
This commit is contained in:
@@ -209,22 +209,24 @@ class CRUDController extends AbstractController
|
||||
* This method:
|
||||
*
|
||||
* 1. Launch `onPreIndex`
|
||||
* x. check acl. If it does return a response instance, return it
|
||||
* x. launch `onPostCheckACL`. If it does return a response instance, return it
|
||||
* 1. count the items, using `countEntities`
|
||||
* 2. build a paginator element from the the number of entities ;
|
||||
* 3. Launch `onPreIndexQuery`. If it does return a response instance, return it
|
||||
* 3. build a query, using `queryEntities`
|
||||
* x. fetch the results, using `getQueryResult`
|
||||
* x. Launch `onPostIndexFetchQuery`. If it does return a response instance, return it
|
||||
* 4. create default parameters:
|
||||
* 2. check acl. If it does return a response instance, return it
|
||||
* 3. launch `onPostCheckACL`. If it does return a response instance, return it
|
||||
* 4. count the items, using `countEntities`
|
||||
* 5. build a paginator element from the the number of entities ;
|
||||
* 6. Launch `onPreIndexQuery`. If it does return a response instance, return it
|
||||
* 7. fetch the results, using `getQueryResult`
|
||||
*
|
||||
* Internally, this build a query, using `queryEntities`
|
||||
*
|
||||
* 8. Launch `onPostIndexFetchQuery`. If it does return a response instance, return it
|
||||
* 9. create default parameters:
|
||||
*
|
||||
* The default parameters are:
|
||||
*
|
||||
* * entities: the list en entities ;
|
||||
* * crud_name: the name of the crud ;
|
||||
* * paginator: a paginator element ;
|
||||
* 5. Launch rendering, the parameter is fetch using `getTemplateFor`
|
||||
* 10. Launch rendering, the parameter is fetch using `getTemplateFor`
|
||||
* The parameters may be personnalized using `generateTemplateParameter`.
|
||||
*
|
||||
* @param string $action
|
||||
@@ -259,16 +261,7 @@ class CRUDController extends AbstractController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$query = $this->queryEntities($action, $request, $paginator);
|
||||
|
||||
$response = $this->onPostIndexBuildQuery($action, $request, $totalItems,
|
||||
$paginator, $query);
|
||||
|
||||
if ($response instanceof Response) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$entities = $this->getQueryResult($action, $request, $totalItems, $paginator, $query);
|
||||
$entities = $this->getQueryResult($action, $request, $totalItems, $paginator);
|
||||
|
||||
$response = $this->onPostIndexFetchQuery($action, $request, $totalItems,
|
||||
$paginator, $entities);
|
||||
@@ -393,11 +386,12 @@ class CRUDController extends AbstractController
|
||||
* @param Request $request
|
||||
* @param int $totalItems
|
||||
* @param PaginatorInterface $paginator
|
||||
* @param mixed $query
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getQueryResult(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query)
|
||||
protected function getQueryResult(string $action, Request $request, int $totalItems, PaginatorInterface $paginator)
|
||||
{
|
||||
$query = $this->queryEntities($action, $request, $paginator);
|
||||
|
||||
return $query->getQuery()->getResult();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user