I've created a custom module to support some backend work with a cron task. The Espo documentation is so incredibly sparse that I've spent hours and hours on this and am just spinning my wheels. I finally discovered an old blog entry referenced on a forum post somewhere here about creating a custom entity that gave me a piece (scope definition for entity) that I had overlooked in trying to copy what's in the Crm module to get this to work.
Here's where I'm at (AAA represents the module name which I can't disclose due to internal business requirements)
Structure:
Modules\AAA\Entities\AAARecord.php - my entity.
Modules\AAA\Resources\metadata\entityDefs\AAARecor d.json - this works correctly, as the rebuild process creates the table as expected.
Modules\AAA\Resources\scopes\AAARecord.json - I just added this tonight
Modules\AAA|Resources\module.json
In my service I have the following code:
And at this point, I get the following error:
I've done an insane amount of debugging to track this down to the Entity Factory trying to map and create my entity within the Espo\Entities namespace, rather than mapping it to the correct namespace of Espo\Modules\AAA\Entities.
Any assistance would be GREATLY appreciated. What am I missing here?
Here's where I'm at (AAA represents the module name which I can't disclose due to internal business requirements)
Structure:
Modules\AAA\Entities\AAARecord.php - my entity.
Modules\AAA\Resources\metadata\entityDefs\AAARecor d.json - this works correctly, as the rebuild process creates the table as expected.
Modules\AAA\Resources\scopes\AAARecord.json - I just added this tonight
Modules\AAA|Resources\module.json
In my service I have the following code:
PHP Code:
$repository = $this->getRepository('AAARecord');
$collection = $repository->find($selectParams);
Code:
PHP Fatal error: Call to a member function getEntityType() on null in /var/www/vhosts/AAA/application/Espo/ORM/DB/Mapper.php on line 104
Any assistance would be GREATLY appreciated. What am I missing here?
Comment