Code Duplication    Length = 9-15 lines in 2 locations

Bundle/BusinessEntityBundle/Helper/BusinessEntityHelper.php 1 location

@@ 54-62 (lines=9) @@
51
     *
52
     * @return BusinessEntity
53
     */
54
    public function findById($id)
55
    {
56
        $businessEntity = $this->reader->findById($id);
57
        if ($businessEntity === null) {
58
            throw new \Exception('"'.$id.'" does not seems to be a valid BusinessEntity');
59
        }
60
61
        return $businessEntity;
62
    }
63
64
    /**
65
     * Get all business entities.

Bundle/BusinessPageBundle/Controller/BusinessTemplateController.php 1 location

@@ 408-422 (lines=15) @@
405
     *
406
     * @return template
407
     */
408
    private function getBusinessEntity($id)
409
    {
410
        //services
411
        $businessEntityManager = $this->get('victoire_core.helper.business_entity_helper');
412
413
        //get the businessEntity
414
        $businessEntity = $businessEntityManager->findById($id);
415
416
        //test the result
417
        if ($businessEntity === null) {
418
            throw new \Exception('The business entity ['.$id.'] was not found.');
419
        }
420
421
        return $businessEntity;
422
    }
423
}
424