symfony - Sonata admin bundle Child Admin::getParentAssociationMapping() not working -
i have: employee entity:
<?php namespace personnelbundle\entity\employee; use; // // class employee extends baseentity { //some fields /** * @orm\onetomany(targetentity="employeemedicalservice", mappedby="employee") */ private $employeemedicalservices; // getters , setters }
and employeemedicalservices entity:
<?php namespace personnelbundle\entity\employee; use // // class employeemedicalservice extends baseentity // fields /** * @orm\manytoone(targetentity="personnelbundle\entity\employee\employee" ,inversedby="employeemedicalservices") * @orm\joincolumn(name="employee_id",referencedcolumnname="id") */ private $employee; //getters setters }
i using sonata admin bundle configuration according sonata admin tutorial on child admins
my admin.yml:
services: {# services #} sonata.admin.employee: class: personnelbundle\admin\employee\employeeadmin tags: - { name: sonata.admin, manager_type: orm, label: "personnel.employee.form.title"} arguments: - ~ - personnelbundle\entity\employee\employee - ~ calls: - [ settranslationdomain, [messages]] - [ addchild, ['@sonata.admin.employee_medical_service']] sonata.admin.employee_medical_service: class: personnelbundle\admin\employee\employeemedicalserviceadmin tags: - { name: sonata.admin, manager_type: orm, label: "personnel.employee.medical_service.form.title"} arguments: - ~ - personnelbundle\entity\employee\employeemedicalservice - ~ calls: - [ settranslationdomain, [messages]]
and have added child admin class employeemedicalserviceadmin:
public function getparentassociationmapping() { return 'employee'; }
but won't work, stuck here , need work
Comments
Post a Comment