[COMPONENT][Collection] Only run queries if the criteria is not empty
This commit is contained in:
parent
da6d3bd351
commit
06ece5b72e
@ -40,13 +40,13 @@ class Collection extends Component
|
|||||||
$actors = [];
|
$actors = [];
|
||||||
if (!\is_null($note_criteria)) {
|
if (!\is_null($note_criteria)) {
|
||||||
$note_qb->addCriteria($note_criteria);
|
$note_qb->addCriteria($note_criteria);
|
||||||
}
|
|
||||||
$notes = $note_qb->getQuery()->execute();
|
$notes = $note_qb->getQuery()->execute();
|
||||||
|
}
|
||||||
|
|
||||||
if (!\is_null($actor_criteria)) {
|
if (!\is_null($actor_criteria)) {
|
||||||
$actor_qb->addCriteria($actor_criteria);
|
$actor_qb->addCriteria($actor_criteria);
|
||||||
}
|
|
||||||
$actors = $actor_qb->getQuery()->execute();
|
$actors = $actor_qb->getQuery()->execute();
|
||||||
|
}
|
||||||
|
|
||||||
// N.B.: Scope is only enforced at FeedController level
|
// N.B.: Scope is only enforced at FeedController level
|
||||||
return ['notes' => $notes ?? null, 'actors' => $actors ?? null];
|
return ['notes' => $notes ?? null, 'actors' => $actors ?? null];
|
||||||
|
Loading…
Reference in New Issue
Block a user