Run onListing callback after applying sort/filtering to the query
This commit is contained in:
parent
7858566e1e
commit
c563c2879b
|
|
@ -59,7 +59,6 @@ class Index
|
||||||
|
|
||||||
$query = $adapter->newQuery($context);
|
$query = $adapter->newQuery($context);
|
||||||
|
|
||||||
run_callbacks($schema->getListeners('listing'), [$query, $context]);
|
|
||||||
run_callbacks($schema->getListeners('scope'), [$query, $context]);
|
run_callbacks($schema->getListeners('scope'), [$query, $context]);
|
||||||
|
|
||||||
$include = $this->getInclude($context);
|
$include = $this->getInclude($context);
|
||||||
|
|
@ -68,6 +67,8 @@ class Index
|
||||||
$this->sort($query, $context);
|
$this->sort($query, $context);
|
||||||
$this->filter($query, $context);
|
$this->filter($query, $context);
|
||||||
|
|
||||||
|
run_callbacks($schema->getListeners('listing'), [$query, $context]);
|
||||||
|
|
||||||
$total = $schema->isCountable() ? $adapter->count($query) : null;
|
$total = $schema->isCountable() ? $adapter->count($query) : null;
|
||||||
$models = $adapter->get($query);
|
$models = $adapter->get($query);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue