PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.0
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Events / License / LicenseRenewed.php

LicenseRenewed.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.0, at app/Events/License/LicenseRenewed.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Events\License;
4
5 use FluentCart\App\Events\EventDispatcher;
6 use FluentCart\App\Models\Order;
7 use FluentCartPro\App\Modules\Licensing\Models\License;
8
9 class LicenseRenewed extends EventDispatcher
10 {
11
12 public string $hook = 'fluent_cart/license_renewed';
13 protected array $listeners = [];
14
15 /**
16 * @var License
17 */
18 public License $license;
19
20 /**
21 * @var Order
22 */
23 public Order $order;
24
25 public function __construct(Order $order, License $license)
26 {
27 $this->order = $order;
28 $this->order->load('customer', 'subscriptions');
29 $this->license = $license;
30 }
31
32
33 public function toArray(): array
34 {
35 return [
36 'order' => $this->order,
37 'license' => $this->license,
38 'customer' => $this->order->customer ?? [],
39 'subscriptions' => $this->order->subscriptions ?? [],
40 ];
41 }
42
43 public function getActivityEventModel()
44 {
45 return $this->license;
46 }
47
48 public function shouldCreateActivity(): bool
49 {
50 return true;
51
52 }
53
54 }