src/Aqarmap/Bundle/ListingBundle/EventListener/CompoundAveragePricePerMeterListener.php line 28
<?phpnamespace Aqarmap\Bundle\ListingBundle\EventListener;use Aqarmap\Bundle\ListingBundle\Event\ListingEvent;use Aqarmap\Bundle\ListingBundle\Service\V4\CompoundAveragePriceService;use Symfony\Component\EventDispatcher\EventSubscriberInterface;class CompoundAveragePricePerMeterListener implements EventSubscriberInterface{public const PRIORITY_ONE = 1;public function __construct(private readonly CompoundAveragePriceService $compoundAveragePriceService){}/*** Calculate Average price per meter for compound units regarding property types.** @param ListingEvent*/public function calculateAveragePricePerMeter(ListingEvent $event): void{$compound = $event->getListing()->getParent();$this->compoundAveragePriceService->addSubscriber($compound);}/*** @return array The event names to listen to*/public static function getSubscribedEvents(): array{return ['aqarmap.project.calculate.average.pricePerMeter' => ['calculateAveragePricePerMeter', self::PRIORITY_ONE],];}}