[CORE] Add option to filter notes even when there's no actor

This commit is contained in:
2021-12-21 10:34:04 -03:00
parent ce91826d31
commit dd5d46c556
4 changed files with 7 additions and 6 deletions

View File

@@ -29,14 +29,16 @@ use App\Entity\Note;
use App\Util\Formatting;
use App\Util\Functional as GSF;
use Doctrine\Common\Collections\ExpressionBuilder;
use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Functional as F;
class Language extends Component
{
public function onFilterNoteList(Actor $actor, array &$notes)
public function onFilterNoteList(?Actor $actor, array &$notes, Request $request)
{
if (\is_null($actor)) return Event::next;
$notes = F\select(
$notes,
fn (Note $n) => \in_array($n->getLanguageId(), ActorLanguage::getActorRelatedLanguagesIds($actor)),