Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 9 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
40 | protected function resolveValues($value, array $args, ResolveInfo $info) { |
||
41 | // `getCreatedTime` is on NodeInterface which feels weird, since there |
||
42 | // is a generic `EntityInterface`. Checking for method existence for now. |
||
43 | if (method_exists($value, 'getCreatedTime')) { |
||
44 | $datetime = new DateTime(); |
||
45 | $datetime->setTimestamp($value->getCreatedTime()); |
||
46 | yield $datetime->format($args['format']); |
||
47 | } |
||
48 | } |
||
49 | |||
51 |