mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix errors on tests in person bundle
This commit is contained in:
@@ -390,13 +390,13 @@ class AccompanyingPeriodController extends AbstractController
|
||||
/** @var Person $person */
|
||||
$person = $this->_getPerson($person_id);
|
||||
|
||||
$criteria = Criteria::create();
|
||||
$criteria->where($criteria->expr()->eq('id', $period_id));
|
||||
|
||||
/* @var $period AccompanyingPeriod */
|
||||
$period = $person->getAccompanyingPeriods()
|
||||
->matching($criteria)
|
||||
->first();
|
||||
$period = \array_filter(
|
||||
$person->getAccompanyingPeriods(),
|
||||
function (AccompanyingPeriod $p) use ($period_id) {
|
||||
return $p->getId() === ($period_id);
|
||||
}
|
||||
)[0] ?? NULL;
|
||||
|
||||
if ($period === NULL) {
|
||||
throw $this->createNotFoundException('period not found');
|
||||
|
Reference in New Issue
Block a user