PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.20
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.20
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 trunk All 48 releases
fluent-cart / app / Events / Subscription / SubscriptionActivated.php

SubscriptionActivated.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.20, at app/Events/Subscription/SubscriptionActivated.php

61 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace FluentCart\App\Events\Subscription;
5
6 use FluentCart\App\Events\EventDispatcher;
7 use FluentCart\App\Listeners;
8 use FluentCart\App\Models\Customer;
9 use FluentCart\App\Models\Order;
10 use FluentCart\App\Models\Subscription;
11
12
13 class SubscriptionActivated extends EventDispatcher
14 {
15 public string $hook = 'fluent_cart/subscription_activated';
16 protected array $listeners = [
17
18 ];
19
20 /**
21 * @var $subscription Subscription
22 */
23 public Subscription $subscription;
24
25 /**
26 * @var $customer Customer|null
27 */
28 public ?Customer $customer;
29
30 /**
31 * @var $order Order|null
32 */
33 public ?Order $order;
34
35 public array $meta = [];
36
37 public function __construct($subscription, $order = null, $customer = null, $meta = [])
38 {
39 $this->subscription = $subscription;
40 $this->order = $order;
41 $this->customer = $customer;
42 $this->meta = $meta;
43 }
44
45
46 public function toArray(): array
47 {
48 return [
49 'subscription' => $this->subscription,
50 'order' => $this->order,
51 'customer' => $this->customer ?? [],
52 'meta' => $this->meta
53 ];
54 }
55
56 public function getActivityEventModel()
57 {
58 return $this->subscription;
59 }
60
61 }