1 | <?php |
||
19 | trait OrganizingMode |
||
20 | { |
||
21 | //<editor-fold desc="Fields"> |
||
22 | /** |
||
23 | * @ORM\Column(type="smallint", nullable=true) |
||
24 | * @var int|null |
||
25 | */ |
||
26 | private $organizingMode; |
||
27 | //</editor-fold desc="Fields"> |
||
28 | |||
29 | //<editor-fold desc="Public Methods"> |
||
30 | /** |
||
31 | * @return int|null |
||
32 | */ |
||
33 | public function getOrganizingMode(): ?int |
||
37 | |||
38 | /** |
||
39 | * @param int|null $organizingMode |
||
40 | * @return $this|OrganizingMode |
||
|
|||
41 | * @throws ValueNotValid |
||
42 | */ |
||
43 | public function setOrganizingMode(?int $organizingMode) |
||
51 | //</editor-fold desc="Public Methods"> |
||
52 | } |
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.