Create Employee Module like Customer module in magento 2
I think this constant in di.xml
:
Magento\Employee\Api\EmployeeMetadataInterface::ENTITY_TYPE_Employee
should be
Magento\Employee\Api\EmployeeMetadataInterface::ENTITY_TYPE_EMPLOYEE
mr.max,
Here is a solution for you:
- Check, if you replaced the files taking into account lowercase and uppercase letters ("customer" -> "employee", "Customer" -> "Employee" etc.)
- Check, if you changed file names and folder names, where there is "Customer" word.
Make sure you haven't changed any other words "Customer". For example, in the file
vendor/magento/module-customer/Controller/Adminhtml/Index/MassSubscribe.php
there is a code
$this->subscriberFactory->create()->subscribeCustomerById($customerId);
That means that the method
subscribeCustomerById
is called from "module-newsletter" module (Magento\Newsletter\Model\Subscriber
). And if you change its name tosubscribeEmployeeById
, you will get errors.