| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function getDocumentFieldValue($entity) |
||
| 16 | { |
||
| 17 | $result = null; |
||
| 18 | $entityValue = $this->getEntityFieldValue($entity); |
||
| 19 | if (!is_null($entityValue)) { |
||
| 20 | if (!$entityValue instanceof \DateTime) { |
||
| 21 | throw new InvalidFieldValueException( |
||
| 22 | sprintf( |
||
| 23 | '"%s" field value of "%s" must be a DateTime instance', |
||
| 24 | $this->getEntityFieldName(), |
||
| 25 | get_class($entity) |
||
| 26 | ) |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | $result = $entityValue->format(self::FORMAT); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $result; |
||
| 33 | } |
||
| 34 | } |