PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.1
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / EventTickets / DataTransferObjects / TicketPurchaseData.php
TicketPurchaseData.php
46 lines 739 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\EventTickets\DataTransferObjects;
4
5 use Give\EventTickets\Models\EventTicketType;
6 use stdClass;
7
8 /**
9 * @since 3.6.0
10 */
11 class TicketPurchaseData
12 {
13 /**
14 * @since 3.6.0
15 * @var int
16 */
17 protected $quantity;
18
19 /**
20 * @since 3.6.0
21 * @var EventTicketType
22 */
23 protected $ticketType;
24
25 /**
26 * @since 3.6.0
27 */
28 public function __get($name)
29 {
30 return $this->$name;
31 }
32
33 /**
34 * @since 3.6.0
35 */
36 public static function fromFieldValueObject(stdClass $object): self
37 {
38 $self = new self();
39
40 $self->quantity = $object->quantity;
41 $self->ticketType = EventTicketType::find($object->ticketId);
42
43 return $self;
44 }
45 }
46