forked from sonata-project/SonataClassificationBundle
/
SonataClassificationBundle.php
49 lines (43 loc) · 1.45 KB
/
SonataClassificationBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\ClassificationBundle;
use Sonata\CoreBundle\Form\FormHelper;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class SonataClassificationBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
$this->registerFormMapping();
}
/**
* {@inheritdoc}
*/
public function boot()
{
$this->registerFormMapping();
}
/**
* Register form mapping information.
*/
public function registerFormMapping()
{
FormHelper::registerFormTypeMapping(array(
'sonata_classification_api_form_category' => 'Sonata\ClassificationBundle\Form\Type\ApiCategoryType',
'sonata_classification_api_form_collection' => 'Sonata\ClassificationBundle\Form\Type\ApiCollectionType',
'sonata_classification_api_form_tag' => 'Sonata\ClassificationBundle\Form\Type\ApiTagType',
'sonata_classification_api_form_context' => 'Sonata\ClassificationBundle\Form\Type\ApiContextType',
'sonata_category_selector' => 'Sonata\ClassificationBundle\Form\Type\CategorySelectorType',
));
}
}