Can I combine these two filters so that I only receive calendar data for this person? I’ve tried a few things, but I’m not getting anywhere. Can I ask something like that here, or is this more of a Discord situation?
Not easy without the structure before me (and I will never get to terms with such a mix of English code and German field and variable names), but I guess you would need some like
Assuming $page is the current actor page:
$sichtbare = $daten->filter(function ($child) use($page) {
$heute = date("Ymd");
// if I got the structure right, the parent of $child is the play that holds the data for the actors involved:
$people = new Pages();
foreach ($child->parent()->menschen()->toStructure() as $item) {
$people->add($item->mensch()->toPages(','));
}
return
$child->sichtbarab()->toDate("YMMdd") <= $heute &&
$child->datum()->toDate("YMMdd") >= $heute &&
$people->has($page);
});
This definitely needs cleaning up, i.e. move stuff to separate methods