-
-
Notifications
You must be signed in to change notification settings - Fork 630
Expand file tree
/
Copy pathAttendeeDomainObject.php
More file actions
115 lines (95 loc) · 3 KB
/
AttendeeDomainObject.php
File metadata and controls
115 lines (95 loc) · 3 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
<?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
{
private ?OrderDomainObject $order = null;
private ?ProductDomainObject $product = null;
/** @var Collection<QuestionAndAnswerViewDomainObject>|null */
public ?Collection $questionAndAnswerViews = null;
public ?AttendeeCheckInDomainObject $checkIn = null;
public static function getDefaultSort(): string
{
return self::CREATED_AT;
}
public static function getAllowedSorts(): AllowedSorts
{
return new AllowedSorts(
[
self::CREATED_AT => [
'asc' => __('Older First'),
'desc' => __('Newer 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,
];
}
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;
}
public function getCheckIn(): ?AttendeeCheckInDomainObject
{
return $this->checkIn;
}
}