| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function addTitleOnPostSerialize(ObjectEvent $event) |
||
| 44 | { |
||
| 45 | $articlePage = $event->getObject(); |
||
| 46 | $visitor = $event->getVisitor(); |
||
| 47 | $context = $event->getContext(); |
||
| 48 | |||
| 49 | if (!$articlePage instanceof ArticlePageDocument) { |
||
| 50 | return; |
||
| 51 | } |
||
| 52 | |||
| 53 | $visitor->addData('title', $context->accept($articlePage->getParent()->getTitle())); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |