Completed
Push — master ( 395774...b3be9a )
by
unknown
16s queued 12s
created

DealerFrontController::show()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Dealer\Controller;
4
5
use Dealer\Model\DealerMetaSeoQuery;
6
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
7
use Thelia\Controller\Front\BaseFrontController;
8
9
10
class DealerFrontController extends BaseFrontController
11
{
12
    public function show($slug)
13
    {
14
        $dealerMetaSeo = DealerMetaSeoQuery::create()
15
            ->filterBySlug($slug)
16
            ->findOne();
17
18
        if(null === $dealerMetaSeo){
19
            throw new NotFoundHttpException();
20
        }
21
22
        return $this->render('dealer-front', ['dealer_id'=>$dealerMetaSeo->getDealerId()]);
23
    }
24
}
25