You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace domain\Product\Rotating\Event;
-
- use domain\Distribution\Distribution\Distribution;
- use domain\Distribution\Distribution\Event\DistributionActiveEvent;
- use domain\Product\Rotating\RotatingModule;
- use justcoded\yii2\eventlistener\observers\Observer;
- use yii\base\ErrorException;
-
- class DistributionObserver extends Observer
- {
- public function events()
- {
- return [
- Distribution::EVENT_ACTIVE => 'onDistributionActive'
- ];
- }
-
- /**
- * @throws ErrorException
- */
- public static function onDistributionActive(DistributionActiveEvent $event): void
- {
- RotatingModule::getInstance()->getManager()->initializeAllRotatingsInDistribution($event->distribution);
- }
- }
|