1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Dealer\Controller; |
4
|
|
|
|
5
|
|
|
use Dealer\Dealer; |
6
|
|
|
use Dealer\Model\DealerMetaSeoQuery; |
7
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse; |
8
|
|
|
use Thelia\Controller\Admin\BaseAdminController; |
9
|
|
|
use Thelia\Form\Exception\FormValidationException; |
10
|
|
|
use Thelia\Tools\URL; |
11
|
|
|
|
12
|
|
|
class MetaSeoController extends BaseAdminController |
13
|
|
|
{ |
14
|
|
|
public function updateSeo() |
15
|
|
|
{ |
16
|
|
|
$form = $this->createForm('dealer.meta.seo'); |
17
|
|
|
try { |
18
|
|
|
$this->validateForm($form); |
19
|
|
|
|
20
|
|
|
$databasesConfiguration = [ |
21
|
|
|
'dealer_id' => $form->getForm()->get('dealer_id')->getData(), |
22
|
|
|
'slug' => $form->getForm()->get('slug')->getData(), |
23
|
|
|
'meta_title' => $form->getForm()->get('meta_title')->getData(), |
24
|
|
|
'meta_description' => $form->getForm()->get('meta_description')->getData(), |
25
|
|
|
'meta_keywords' => $form->getForm()->get('meta_keywords')->getData(), |
26
|
|
|
'meta_json' => $form->getForm()->get('meta_json')->getData(), |
27
|
|
|
]; |
28
|
|
|
|
29
|
|
|
$dealerSeo = DealerMetaSeoQuery::create() |
30
|
|
|
->filterByDealerId($databasesConfiguration["dealer_id"]) |
31
|
|
|
->findOneOrCreate(); |
32
|
|
|
|
33
|
|
|
$dealerSeo |
34
|
|
|
->setJson( $databasesConfiguration["meta_json"]) |
35
|
|
|
->setSlug($databasesConfiguration["slug"]) |
36
|
|
|
->setMetaTitle($databasesConfiguration["meta_title"]) |
37
|
|
|
->setMetaDescription($databasesConfiguration["meta_description"]) |
38
|
|
|
->setMetaKeywords($databasesConfiguration["meta_keywords"]) |
39
|
|
|
->save(); |
40
|
|
|
|
41
|
|
|
return RedirectResponse::create( |
42
|
|
|
URL::getInstance()->absoluteUrl('admin/module/Dealer/dealer') |
43
|
|
|
); |
44
|
|
|
|
45
|
|
|
} catch (FormValidationException $exception) { |
|
|
|
|
46
|
|
|
if (!$form->getForm()->isValid()) { |
47
|
|
|
$this->setupFormErrorContext( |
48
|
|
|
'Dealer meta seo manager', |
49
|
|
|
$this->createStandardFormValidationErrorMessage($exception), |
50
|
|
|
$form |
51
|
|
|
); |
52
|
|
|
$form->setErrorMessage(null); |
53
|
|
|
} else { |
54
|
|
|
$this->setupFormErrorContext( |
55
|
|
|
'Dealer meta seo manager', |
56
|
|
|
$exception->getMessage(), |
57
|
|
|
$form |
58
|
|
|
); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
$response = $this->render( |
62
|
|
|
'module-configure', |
63
|
|
|
[ |
64
|
|
|
'module_code' => Dealer::DOMAIN_NAME |
65
|
|
|
] |
66
|
|
|
); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
return $response; |
70
|
|
|
} |
71
|
|
|
} |
Scrutinizer analyzes your
composer.json
/composer.lock
file if available to determine the classes, and functions that are defined by your dependencies.It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.