I'm trying to create custom Form in Sonata-Admin and Im geting No entity manager defined for class School\ChildBirthBundle\Entity\DataChapter
My code:
namespace School\ChildBirthBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Knp\Menu\ItemInterface as MenuItemInterface;
use School\ChildBirthBundle\Entity\DataChapter;
class DataChapterAdmin extends Admin
{
protected function configureShowFields(ShowMapper $showMapper)
{
$showMapper
->add('name')
->add('status')
;
}
sonata.admin.data_chapter:
class: School\ChildBirthBundle\Admin\DataChapterAdmin
tags:
- { name: sonata.admin, manager_type: orm, group: "Content", label: "Chapter" }
arguments:
- ~
- School\ChildBirthBundle\Entity\DataChapter
- ~
- @doctrine.orm.default_entity_manager
calls:
- [ setTranslationDomain, [SchoolChildBirthBundle]]
And entity looks like this
namespace School\ChildBirthBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="data_chapter")
*/
class DataChapter
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=255)
*/
protected $name;
/**
* @ORM\Column(type="integer", length=1)
*/
protected $status;
/**
* @ORM\Column(type="integer")
*/
protected $idSubject;
}
I dont know what im doing wrong