Code Duplication    Length = 5-5 lines in 2 locations

Bundle/PageBundle/Helper/PageHelper.php 1 location

@@ 320-324 (lines=5) @@
317
                    $entityProxy = new EntityProxy();
318
                    $accessor = new PropertyAccessor();
319
320
                    if (method_exists($entity, 'getId')) {
321
                        $entityId = $entity->getId();
322
                    } else {
323
                        $entityId = $accessor->getValue($entity, $page->getBusinessEntity()->getBusinessIdentifiers()->first()->getName());
324
                    }
325
                    $entityProxy->setRessourceId($entityId);
326
                    $this->findEntityByReference($viewReference);
327

Bundle/ViewReferenceBundle/Helper/ViewReferenceHelper.php 1 location

@@ 46-50 (lines=5) @@
43
            $id = $view->getTemplate()->getId();
44
            $accessor = new PropertyAccessor();
45
            $entity = $view->getEntity();
46
            if (method_exists($entity, 'getId')) {
47
                $entityId = $entity->getId();
48
            } else {
49
                $entityId = $accessor->getValue($entity, $view->getBusinessEntity()->getBusinessIdentifiers()->first()->getName());
50
            }
51
        } elseif (!$view instanceof WebViewInterface) {
52
            return $view->getId();
53
        }