diff --git a/src/Model/Table/SelectionsTable.php b/src/Model/Table/SelectionsTable.php index 7df4c8ed..dbb35da9 100644 --- a/src/Model/Table/SelectionsTable.php +++ b/src/Model/Table/SelectionsTable.php @@ -204,7 +204,7 @@ public function afterSave(Event $event, EntityInterface $entity, ArrayObject $op public function beforeSave(Event $event, Selection $entity, ArrayObject $options): void { if ($entity->isDirty('processed') && $entity->processed) { - $this->loadService('SelectionService'); + $this->loadService('Selection'); $this->Selection->save($entity); } diff --git a/src/Service/ComputeScoreService.php b/src/Service/ComputeScoreService.php index 7a1a0522..b8a849b9 100644 --- a/src/Service/ComputeScoreService.php +++ b/src/Service/ComputeScoreService.php @@ -8,11 +8,17 @@ use App\Model\Entity\Matchday; use App\Model\Entity\Score; use App\Model\Entity\Team; +use Burzum\CakeServiceLayer\Service\ServiceAwareTrait; use Cake\ORM\Locator\LocatorAwareTrait; +/** + * @property \App\Service\LineupService $Lineup + */ +#[\AllowDynamicProperties] class ComputeScoreService { use LocatorAwareTrait; + use ServiceAwareTrait; /** * Undocumented function @@ -20,8 +26,9 @@ class ComputeScoreService * @throws \Cake\Core\Exception\CakeException * @throws \UnexpectedValueException */ - public function __construct(private LineupService $Lineup) + public function __construct() { + $this->loadService('Lineup'); } /** diff --git a/src/Service/SelectionService.php b/src/Service/SelectionService.php index 691ce08e..8f046aa0 100644 --- a/src/Service/SelectionService.php +++ b/src/Service/SelectionService.php @@ -5,21 +5,28 @@ use App\Model\Entity\Selection; use App\Model\Entity\Transfert; +use Burzum\CakeServiceLayer\Service\ServiceAwareTrait; use Cake\Mailer\Mailer; use Cake\ORM\Locator\LocatorAwareTrait; use WebPush\Notification; +/** + * @property \App\Service\PushNotificationService $PushNotification + */ +#[\AllowDynamicProperties] class SelectionService { use LocatorAwareTrait; + use ServiceAwareTrait; /** * Construct * * @throws \UnexpectedValueException */ - public function __construct(private PushNotificationService $PushNotification) + public function __construct() { + $this->loadService('PushNotification'); } /** diff --git a/src/Service/TeamService.php b/src/Service/TeamService.php index 55f1c1d3..df301376 100644 --- a/src/Service/TeamService.php +++ b/src/Service/TeamService.php @@ -4,25 +4,33 @@ namespace App\Service; use App\Model\Entity\Team; +use Burzum\CakeServiceLayer\Service\ServiceAwareTrait; use Cake\Core\Configure; use Cake\ORM\Locator\LocatorAwareTrait; use GetStream\Stream\Client; +/** + * @property \App\Service\NotificationSubscriptionService $NotificationSubscription + * @property \App\Service\ScoreService $Score + */ +#[\AllowDynamicProperties] class TeamService { use LocatorAwareTrait; + use ServiceAwareTrait; /** * Constructor * * @throws \UnexpectedValueException */ - public function __construct( - private ScoreService $Score, - private NotificationSubscriptionService $NotificationSubscription - ) { + public function __construct() + { + $this->loadService('Score'); + $this->loadService('NotificationSubscription'); } + /** * Create new team * diff --git a/src/Service/TransfertService.php b/src/Service/TransfertService.php index 65adde9a..507a454f 100644 --- a/src/Service/TransfertService.php +++ b/src/Service/TransfertService.php @@ -7,24 +7,28 @@ use App\Model\Entity\MembersTeam; use App\Model\Entity\Transfert; use ArrayObject; +use Burzum\CakeServiceLayer\Service\ServiceAwareTrait; use Cake\ORM\Locator\LocatorAwareTrait; /** * @property \App\Service\LineupService $Lineup */ -#[AllowDynamicProperties] +#[\AllowDynamicProperties] class TransfertService { use LocatorAwareTrait; + use ServiceAwareTrait; + /** * Constructor * * @throws \Cake\Core\Exception\CakeException * @throws \UnexpectedValueException */ - public function __construct(private LineupService $Lineup) + public function __construct() { + $this->loadService('Lineup'); } /**