1 | <?php |
||
29 | trait RankingSystem |
||
30 | { |
||
31 | use SubClassData; |
||
32 | use TimestampableEntity; |
||
33 | use UUIDEntity; |
||
34 | use NameEntity; |
||
35 | |||
36 | //<editor-fold desc="Fields"> |
||
37 | |||
38 | /** |
||
39 | * @ORM\Column(type="string") |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $serviceName; |
||
44 | /** |
||
45 | * @ORM\Column(type="smallint", nullable=true) |
||
46 | * @var int|null |
||
47 | */ |
||
48 | private $defaultForLevel; |
||
49 | |||
50 | /** |
||
51 | * @ORM\Column(type="integer") |
||
52 | * @var int |
||
53 | */ |
||
54 | private $generationInterval; |
||
55 | |||
56 | /** |
||
57 | * @ORM\ManyToMany( |
||
58 | * targetEntity="\Tfboe\FmLib\Entity\Helpers\TournamentHierarchyEntity", |
||
59 | * mappedBy="rankingSystems", |
||
60 | * indexBy="id" |
||
61 | * ) |
||
62 | * @ORM\JoinTable(name="relation__tournament_ranking_systems") |
||
63 | * @var Collection|TournamentInterface[] |
||
64 | */ |
||
65 | private $hierarchyEntries; |
||
66 | /** |
||
67 | * @ORM\Column(type="datetime", nullable=true) |
||
68 | * @var \DateTime|null |
||
69 | */ |
||
70 | private $openSyncFrom; |
||
71 | |||
72 | /** |
||
73 | * @ORM\Column(type="datetime", nullable=true) |
||
74 | * @var \DateTime|null |
||
75 | */ |
||
76 | private $openSyncFromInProcess; |
||
77 | |||
78 | /** |
||
79 | * @ORM\OneToMany(targetEntity="\Tfboe\FmLib\Entity\RankingSystemListInterface", mappedBy="rankingSystem", |
||
80 | * indexBy="id") |
||
81 | * @var Collection|RankingSystemListInterface[] |
||
82 | */ |
||
83 | private $lists; |
||
84 | //</editor-fold desc="Fields"> |
||
85 | |||
86 | //<editor-fold desc="Constructor"> |
||
87 | //</editor-fold desc="Constructor"> |
||
88 | |||
89 | //<editor-fold desc="Public Methods"> |
||
90 | /** |
||
91 | * @return int|null |
||
92 | */ |
||
93 | public function getDefaultForLevel(): ?int |
||
97 | |||
98 | /** |
||
99 | * @return int |
||
100 | */ |
||
101 | public function getGenerationInterval(): int |
||
105 | |||
106 | /** |
||
107 | * @return TournamentInterface[]|Collection |
||
108 | */ |
||
109 | public function getHierarchyEntries() |
||
113 | |||
114 | /** |
||
115 | * @return RankingSystemListInterface[]|Collection |
||
116 | */ |
||
117 | public function getLists(): Collection |
||
121 | |||
122 | /** |
||
123 | * @return \DateTime|null |
||
124 | */ |
||
125 | public function getOpenSyncFrom(): ?\DateTime |
||
129 | |||
130 | /** |
||
131 | * @return \DateTime|null |
||
132 | */ |
||
133 | public function getOpenSyncFromInProcess(): ?\DateTime |
||
137 | |||
138 | /** |
||
139 | * @return string |
||
140 | */ |
||
141 | public function getServiceName(): string |
||
145 | |||
146 | /** |
||
147 | * @param int|null $defaultForLevel |
||
148 | * @throws ValueNotValid |
||
149 | */ |
||
150 | public function setDefaultForLevel(?int $defaultForLevel) |
||
157 | |||
158 | /** |
||
159 | * @param int $generationInterval |
||
160 | * @throws \Tfboe\FmLib\Exceptions\ValueNotValid |
||
161 | */ |
||
162 | public function setGenerationInterval(int $generationInterval) |
||
167 | |||
168 | /** |
||
169 | * @param \DateTime|null $openSyncFrom |
||
170 | */ |
||
171 | public function setOpenSyncFrom(?\DateTime $openSyncFrom) |
||
175 | |||
176 | /** |
||
177 | * @param \DateTime|null $openSyncFromInProcess |
||
178 | * @return $this|RankingSystem |
||
|
|||
179 | */ |
||
180 | public function setOpenSyncFromInProcess(?\DateTime $openSyncFromInProcess): RankingSystem |
||
185 | |||
186 | /** |
||
187 | * @param string $serviceName |
||
188 | */ |
||
189 | public function setServiceName(string $serviceName) |
||
193 | //</editor-fold desc="Public Methods"> |
||
194 | |||
195 | //<editor-fold desc="Protected Final Methods"> |
||
196 | /** |
||
197 | * RankingSystem init |
||
198 | * @param string[] $keys the keys of the subclass properties |
||
199 | */ |
||
200 | protected final function init(array $keys) |
||
209 | //</editor-fold desc="Protected Final Methods"> |
||
210 | } |
In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.
If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.