1 | <?php |
||
19 | class CustomerOrder |
||
20 | { |
||
21 | use TimestampableTrait; |
||
22 | |||
23 | const STATUS_OPENED = 'opened'; |
||
24 | const STATUS_CLOSED = 'closed'; |
||
25 | const STATUS_PENDING = 'pending'; |
||
26 | const STATUS_PAID = 'paid'; |
||
27 | const STATUS_REJECTED = 'rejected'; |
||
28 | |||
29 | /** |
||
30 | * @var Uuid |
||
31 | * |
||
32 | * @ORM\Column(name="id", type="uuid_binary") |
||
33 | * @ORM\Id |
||
34 | * @ORM\GeneratedValue(strategy="UUID") |
||
35 | */ |
||
36 | private $id; |
||
37 | |||
38 | /** |
||
39 | * @var ArrayCollection|Ticket[] |
||
40 | * |
||
41 | * @ORM\OneToMany( |
||
42 | * targetEntity="AppBundle\Entity\Ticket", |
||
43 | * mappedBy="customerOrder", |
||
44 | * cascade={"persist", "remove"} |
||
45 | * ) |
||
46 | */ |
||
47 | protected $tickets; |
||
48 | |||
49 | /** |
||
50 | * @var Enum |
||
51 | * @Assert\Choice(callback="getStatuses") |
||
52 | * @ORM\Column( |
||
53 | * name="status", |
||
54 | * type="string", |
||
55 | * columnDefinition="enum('free', 'booked', 'ordered', 'opened', 'closed')" |
||
56 | * ) |
||
57 | * @Expose() |
||
58 | */ |
||
59 | protected $status; |
||
60 | |||
61 | /** |
||
62 | * @var Customer |
||
63 | * |
||
64 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Customer") |
||
65 | */ |
||
66 | protected $customer; |
||
67 | |||
68 | /** |
||
69 | * CustomerOrder constructor. |
||
70 | */ |
||
71 | public function __construct(Customer $customer) |
||
77 | |||
78 | /** |
||
79 | * @return Uuid |
||
80 | */ |
||
81 | public function getId() |
||
85 | |||
86 | /** |
||
87 | * @return Ticket[]|ArrayCollection |
||
88 | */ |
||
89 | public function getTickets() |
||
93 | |||
94 | /** |
||
95 | * @param Ticket[]|ArrayCollection $tickets |
||
96 | */ |
||
97 | public function setTickets($tickets) |
||
101 | |||
102 | /** |
||
103 | * @return Enum |
||
104 | */ |
||
105 | public function getStatus() |
||
109 | |||
110 | /** |
||
111 | * @param Enum $status |
||
112 | */ |
||
113 | public function setStatus($status) |
||
117 | |||
118 | /** |
||
119 | * Add Ticket |
||
120 | * |
||
121 | * @param Ticket $ticket |
||
122 | * @return CustomerOrder |
||
123 | */ |
||
124 | public function addTicket(Ticket $ticket) |
||
133 | |||
134 | /** |
||
135 | * @param Ticket $ticket |
||
136 | */ |
||
137 | public function removeTicket(Ticket $ticket) |
||
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | private function isStatusPaid() |
||
152 | |||
153 | /** |
||
154 | * @return array |
||
155 | */ |
||
156 | public static function getStatuses() |
||
166 | |||
167 | /** |
||
168 | * Set customer |
||
169 | * |
||
170 | * @param \AppBundle\Entity\Customer $customer |
||
171 | * |
||
172 | * @return CustomerOrder |
||
173 | */ |
||
174 | public function setCustomer(\AppBundle\Entity\Customer $customer = null) |
||
180 | |||
181 | /** |
||
182 | * Get customer |
||
183 | * |
||
184 | * @return \AppBundle\Entity\Customer |
||
185 | */ |
||
186 | public function getCustomer() |
||
190 | } |
||
191 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..