-
-
Notifications
You must be signed in to change notification settings - Fork 663
Expand file tree
/
Copy pathAttendeeDomainObject.php
More file actions
155 lines (128 loc) · 4.21 KB
/
Copy pathAttendeeDomainObject.php
File metadata and controls
155 lines (128 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
namespace HiEvents\DomainObjects;
use HiEvents\DomainObjects\Interfaces\IsFilterable;
use HiEvents\DomainObjects\Interfaces\IsSortable;
use HiEvents\DomainObjects\SortingAndFiltering\AllowedSorts;
use Illuminate\Support\Collection;
class AttendeeDomainObject extends Generated\AttendeeDomainObjectAbstract implements IsSortable, IsFilterable
{
public const TICKET_NAME_SORT_KEY = 'ticket_name';
private ?OrderDomainObject $order = null;
private ?ProductDomainObject $product = null;
/** @var Collection<QuestionAndAnswerViewDomainObject>|null */
public ?Collection $questionAndAnswerViews = null;
public ?AttendeeCheckInDomainObject $checkIn = null;
/** @var Collection<AttendeeCheckInDomainObject>|null */
private ?Collection $checkIns = null;
private ?EventOccurrenceDomainObject $eventOccurrence = null;
public static function getDefaultSort(): string
{
return self::CREATED_AT;
}
public static function getAllowedSorts(): AllowedSorts
{
return new AllowedSorts(
[
self::TICKET_NAME_SORT_KEY => [
'asc' => __('Ticket Name A-Z'),
'desc' => __('Ticket Name Z-A'),
],
self::CREATED_AT => [
'asc' => __('Older First'),
'desc' => __('Newest First'),
],
self::UPDATED_AT => [
'desc' => __('Recently Updated First'),
'asc' => __('Recently Updated Last'),
],
self::FIRST_NAME => [
'asc' => __('First Name A-Z'),
'desc' => __('First Name Z-A'),
],
self::LAST_NAME => [
'asc' => __('Last Name A-Z'),
'desc' => __('Last Name Z-A'),
],
self::STATUS => [
'asc' => __('Status A-Z'),
'desc' => __('Status Z-A'),
],
]
);
}
public static function getDefaultSortDirection(): string
{
return 'desc';
}
public static function getAllowedFilterFields(): array
{
return [
self::STATUS,
self::PRODUCT_ID,
self::PRODUCT_PRICE_ID,
self::EVENT_OCCURRENCE_ID,
];
}
public function getOrder(): ?OrderDomainObject
{
return $this->order;
}
public function setOrder(?OrderDomainObject $order): void
{
$this->order = $order;
}
public function getFullName(): string
{
return $this->first_name . ' ' . $this->last_name;
}
public function getProduct(): ?ProductDomainObject
{
return $this->product;
}
public function setProduct(?ProductDomainObject $product): self
{
$this->product = $product;
return $this;
}
public function setQuestionAndAnswerViews(?Collection $questionAndAnswerViews): AttendeeDomainObject
{
$this->questionAndAnswerViews = $questionAndAnswerViews;
return $this;
}
public function getQuestionAndAnswerViews(): ?Collection
{
return $this->questionAndAnswerViews;
}
public function setCheckIn(?AttendeeCheckInDomainObject $checkIn): AttendeeDomainObject
{
$this->checkIn = $checkIn;
return $this;
}
/**
* Only use in the context when a single check-in is expected (e.g., when loading a list of attendees for a specific check-in list).
*
* @return AttendeeCheckInDomainObject|null
*/
public function getCheckIn(): ?AttendeeCheckInDomainObject
{
return $this->checkIn;
}
public function setCheckIns(?Collection $checkIns): AttendeeDomainObject
{
$this->checkIns = $checkIns;
return $this;
}
public function getCheckIns(): ?Collection
{
return $this->checkIns;
}
public function setEventOccurrence(?EventOccurrenceDomainObject $eventOccurrence): AttendeeDomainObject
{
$this->eventOccurrence = $eventOccurrence;
return $this;
}
public function getEventOccurrence(): ?EventOccurrenceDomainObject
{
return $this->eventOccurrence;
}
}