added getSelf

This commit is contained in:
tracer 2022-10-08 10:58:18 +02:00
parent 6cca02b1cf
commit 79942030fa
1 changed files with 12 additions and 0 deletions

View File

@ -257,4 +257,16 @@ class PanelRepository
exit($e->getMessage());
}
}
public function getSelf(): ?Panel
{
$panels = $this->findAll();
foreach ($panels as $panel) {
if ($panel->getSelf() === 'yes') {
return $panel;
}
}
return null;
}
}