1 | <?php |
||
31 | class Comestible implements UserReferenceInterface, RelatedObjectInterface |
||
32 | { |
||
33 | use AccessorTrait; |
||
34 | use UserReferenceTrait; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | * @ORM\Column(name="id", type="string", length=24) |
||
39 | * @ORM\Id |
||
40 | * @ORM\GeneratedValue(strategy="NONE") |
||
41 | */ |
||
42 | protected $id; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | * @ORM\Column(name="name", type="string", nullable=false) |
||
47 | */ |
||
48 | protected $name; |
||
49 | |||
50 | /** |
||
51 | * @var float |
||
52 | * @ORM\Column(name="calorie", type="decimal", precision=10, scale=4, nullable=false) |
||
53 | */ |
||
54 | protected $calorie = 0; |
||
55 | |||
56 | /** |
||
57 | * @var float |
||
58 | * @ORM\Column(name="protein", type="decimal", precision=10, scale=4, nullable=false) |
||
59 | */ |
||
60 | protected $protein = 0; |
||
61 | |||
62 | /** |
||
63 | * @var float |
||
64 | * @ORM\Column(name="carbohydrate", type="decimal", precision=10, scale=4, nullable=false) |
||
65 | */ |
||
66 | protected $carbohydrate = 0; |
||
67 | |||
68 | /** |
||
69 | * @var float |
||
70 | * @ORM\Column(name="fat", type="decimal", precision=10, scale=4, nullable=false) |
||
71 | */ |
||
72 | protected $fat = 0; |
||
73 | |||
74 | /** |
||
75 | * @var float |
||
76 | * @ORM\Column(name="default_value", type="decimal", precision=10, scale=4, nullable=true) |
||
77 | */ |
||
78 | protected $defaultValue; |
||
79 | |||
80 | /** |
||
81 | * @var \DateTime |
||
82 | * @ORM\Column(name="created_at", type="datetime", nullable=true) |
||
83 | */ |
||
84 | protected $createdAt; |
||
85 | |||
86 | public function __construct() |
||
87 | { |
||
88 | $this->id = new \MongoId(); |
||
|
|||
89 | $this->createdAt = new \DateTime(); |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function __toString() |
||
96 | { |
||
97 | return (string) $this->getName(); |
||
98 | } |
||
99 | |||
100 | protected function _initProps() |
||
101 | { |
||
102 | $this->_prop((new Prop('id', Hint::INT))->method(Get::PREFIX)); |
||
103 | $this->_prop((new Prop('name', Hint::STRING))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
104 | $this->_prop((new Prop('calorie', Hint::NUMERIC))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
105 | $this->_prop((new Prop('protein', Hint::NUMERIC))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
106 | $this->_prop((new Prop('carbohydrate', Hint::NUMERIC))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
107 | $this->_prop((new Prop('fat', Hint::NUMERIC))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
108 | $this->_prop((new Prop('defaultValue', Hint::NUMERIC))->method(Get::PREFIX)->method(Set::PREFIX)); |
||
109 | $this->_prop((new Prop('createdAt', '\DateTime'))->method(Get::PREFIX)); |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getRoleNamePart() |
||
119 | } |
||
120 |
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..