@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | private $formBuilder; |
22 | 22 | |
23 | 23 | |
24 | - public function getFormatValue($value){ |
|
25 | - if(!$value){ |
|
24 | + public function getFormatValue($value) { |
|
25 | + if (!$value) { |
|
26 | 26 | return null; |
27 | 27 | } |
28 | - if(!$this->formBuilder->getOption('class')){ |
|
28 | + if (!$this->formBuilder->getOption('class')) { |
|
29 | 29 | return $value; |
30 | 30 | } |
31 | 31 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * Если значение число, то пытаемся найти его по ID. |
56 | 56 | * Если значение не число, то ищем его по полю name |
57 | 57 | */ |
58 | - if(is_numeric($value)){ |
|
58 | + if (is_numeric($value)) { |
|
59 | 59 | $value = $repo->find($value); |
60 | 60 | } else { |
61 | 61 | try { |
@@ -3,9 +3,9 @@ |
||
3 | 3 | |
4 | 4 | namespace Doctrs\SonataImportBundle\Service\SonataImportType; |
5 | 5 | |
6 | -class BooleanType implements ImportInterface{ |
|
6 | +class BooleanType implements ImportInterface { |
|
7 | 7 | |
8 | - public function getFormatValue($value){ |
|
8 | + public function getFormatValue($value) { |
|
9 | 9 | return filter_var($value, FILTER_VALIDATE_BOOLEAN); |
10 | 10 | } |
11 | 11 |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Sonata\AdminBundle\Admin\AbstractAdmin; |
6 | 6 | |
7 | -interface AdminAbstractAwareInterface{ |
|
7 | +interface AdminAbstractAwareInterface { |
|
8 | 8 | public function setAdminAbstract(AbstractAdmin $abstractAdmin); |
9 | 9 | } |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Component\Form\FormBuilderInterface; |
6 | 6 | |
7 | -interface FormBuilderAwareInterface{ |
|
7 | +interface FormBuilderAwareInterface { |
|
8 | 8 | public function setFormBuilder(FormBuilderInterface $formBuilder); |
9 | 9 | } |
@@ -3,9 +3,9 @@ |
||
3 | 3 | |
4 | 4 | namespace Doctrs\SonataImportBundle\Service\SonataImportType; |
5 | 5 | |
6 | -class IntegerType implements ImportInterface{ |
|
6 | +class IntegerType implements ImportInterface { |
|
7 | 7 | |
8 | - public function getFormatValue($value){ |
|
8 | + public function getFormatValue($value) { |
|
9 | 9 | return (int)$value; |
10 | 10 | } |
11 | 11 |
@@ -3,9 +3,9 @@ |
||
3 | 3 | |
4 | 4 | namespace Doctrs\SonataImportBundle\Service\SonataImportType; |
5 | 5 | |
6 | -class DateType implements ImportInterface{ |
|
6 | +class DateType implements ImportInterface { |
|
7 | 7 | |
8 | - public function getFormatValue($value){ |
|
8 | + public function getFormatValue($value) { |
|
9 | 9 | return $value ? new \DateTime($value) : null; |
10 | 10 | } |
11 | 11 |
@@ -191,10 +191,10 @@ |
||
191 | 191 | |
192 | 192 | $class = $this->getContainer()->get($item['class']); |
193 | 193 | |
194 | - if($class instanceof AdminAbstractAwareInterface){ |
|
194 | + if ($class instanceof AdminAbstractAwareInterface) { |
|
195 | 195 | $class->setAdminAbstract($admin); |
196 | 196 | } |
197 | - if($class instanceof FormBuilderAwareInterface){ |
|
197 | + if ($class instanceof FormBuilderAwareInterface) { |
|
198 | 198 | $class->setFormBuilder($formBuilder); |
199 | 199 | } |
200 | 200 |
@@ -31,23 +31,23 @@ |
||
31 | 31 | * @param array $config |
32 | 32 | * @param ContainerBuilder $container |
33 | 33 | */ |
34 | - private function prepairConfig(array $config, ContainerBuilder $container){ |
|
34 | + private function prepairConfig(array $config, ContainerBuilder $container) { |
|
35 | 35 | $config['mappings'] = array_merge($config['mappings'], [[ |
36 | 36 | 'name' => 'date', |
37 | 37 | 'class' => 'doctrs.type.datetime' |
38 | - ],[ |
|
38 | + ], [ |
|
39 | 39 | 'name' => 'datetime', |
40 | 40 | 'class' => 'doctrs.type.datetime' |
41 | - ],[ |
|
41 | + ], [ |
|
42 | 42 | 'name' => 'boolean', |
43 | 43 | 'class' => 'doctrs.type.boolean' |
44 | - ],[ |
|
44 | + ], [ |
|
45 | 45 | 'name' => 'integer', |
46 | 46 | 'class' => 'doctrs.type.integer' |
47 | - ],[ |
|
47 | + ], [ |
|
48 | 48 | 'name' => 'entity', |
49 | 49 | 'class' => 'doctrs.type.entity' |
50 | - ],[ |
|
50 | + ], [ |
|
51 | 51 | 'name' => 'choice', |
52 | 52 | 'class' => 'doctrs.type.entity' |
53 | 53 | ]]); |