| Conditions | 2 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function persistTimestampedFields(object $timestamped, bool $isNew): void |
||
| 36 | { |
||
| 37 | $configuration = $this->annotationReader->getConfiguration($timestamped); |
||
| 38 | $classMetadata = $this->getClassMetadata($timestamped); |
||
| 39 | $classMetadata->setFieldValue($timestamped, $configuration->createdAtField, $isNew ? |
||
| 40 | new \DateTimeImmutable() : |
||
| 41 | $classMetadata->getFieldValue($timestamped, $configuration->createdAtField)); |
||
| 42 | $classMetadata->setFieldValue($timestamped, $configuration->modifiedAtField, new \DateTime()); |
||
| 43 | } |
||
| 45 |