/** * purchase key calculated from the cartitem * @param Event $event * @param Order $order * @param CartItem $cartItem */ public function onCartPurchaseKey(Event $event, Order $order, CartItem $cartItem) { /** @var File $file */ $file = $cartItem->loadItemModel(); $orderValid = $this->validateOrder($order, $cartItem, $file); $event->addParameters(['invalidPurchaseKey' => !empty($event['allowPurchaseKey']) ? $event['allowPurchaseKey'] : !$orderValid], true); }
/** * Constructor. * * @param string $name * @param UserInterface $user */ public function __construct($name, UserInterface $user = null) { parent::__construct($name); $this->user = $user; }
/** * Constructor. * * @param string $name * @param string $template * @param array $parameters */ public function __construct($name, $template, array $parameters = []) { parent::__construct($name, $parameters); $this->template = $template; }
/** * Constructor. * * @param string $name * @param string $content * @param array $parameters */ public function __construct($name, $content, array $parameters = []) { parent::__construct($name, $parameters); $this->content = $content; }
/** * Constructor. * * @param string $name * @param HttpKernelInterface $kernel */ public function __construct($name, HttpKernelInterface $kernel) { parent::__construct($name); $this->kernel = $kernel; }