@@ 152-160 (lines=9) @@ | ||
149 | /** |
|
150 | * {@inheritdoc} |
|
151 | */ |
|
152 | public function setCreatedAt($createdAt) |
|
153 | { |
|
154 | if (!is_int($createdAt) && !$createdAt instanceof \DateTime) { |
|
155 | throw new \InvalidArgumentException(sprintf('Integer or \DateTime expected, got: "%s".', Exception::typeOf($createdAt))); |
|
156 | } |
|
157 | ||
158 | $this->createdAt = is_int($createdAt) ? date_timestamp_set(new \DateTime(), $createdAt) : $createdAt; |
|
159 | return $this; |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * {@inheritdoc} |
|
@@ 173-181 (lines=9) @@ | ||
170 | /** |
|
171 | * {@inheritdoc} |
|
172 | */ |
|
173 | public function setModifiedAt($modifiedAt) |
|
174 | { |
|
175 | if (!is_int($modifiedAt) && !$modifiedAt instanceof \DateTime) { |
|
176 | throw new \InvalidArgumentException(sprintf('Integer or \DateTime expected, got: "%s".', Exception::typeOf($modifiedAt))); |
|
177 | } |
|
178 | ||
179 | $this->modifiedAt = is_int($modifiedAt) ? date_timestamp_set(new \DateTime(), $modifiedAt) : $modifiedAt; |
|
180 | return $this; |
|
181 | } |
|
182 | } |
|
183 |