I have a simple relation model in my project, I have requests and comments and created admins classes for both entities. They works just fine as separate admins, and all relations works fine on a public part of the project, but I can't set up comments as a child admin class for requests.
here is what I have in services.yaml
admin.maintenanceRequest:
class: App\Admin\MaintenanceRequestAdmin
arguments: [~, App\Entity\MaintenanceRequest ,~]
tags:
- {name: sonata.admin, manager_type: orm, label: Maintenance }
public: true
calls:
- [ addChild, ['@App\Admin\MaintenanceCommentAdmin', 'maintenance_request_id']]
I also defined $parentAssociationMapping in my child admin class:
protected $parentAssociationMapping = 'maintenance_request_id';
But it leads to this error:
Cannot autowire service "App\Admin\MaintenanceCommentAdmin": argument "$code" of method "Sonata\AdminBundle\Admin\AbstractAdmin::__construct()" has no type-hint, you should configure its value explicitly.
I tried to find solution on my own for quite a while, but seems like no one have problem with that. Hope someone can help me, Im really new to sonata and coding in general, any help would be greatly appreciated. I'll provide any additional info if it's required.