Calling a service method from another service. [ESPO Upgrade 6.1.0 -> 7.0.10]
Collapse
X
-
Record services are the layer for CRUD operations being made via API. So I wouldn't recommend using them in business logic.
From the record service:
PHP Code:$anotherRecordService = $this->recordServiceContainer->get($entityType);
-
Hello,
my knowledge is old (bad certainly).. now if i understand, you can call anything from anything..
i have not understand DI ...maybe if i undertand english
but this work..
look this : https://github.com/hturkoz/espocrm-h...ae4eb3921823ba
look full file.. construct..
$myService = $this->serviceFactory->create('MyService');
$myService->process( $myData->getRaw() );
so you can call any service from any other place
Yuri is incredibleLast edited by item; 04-13-2022, 08:13 PM.Leave a comment:
-
Leave a comment:
-
Calling a service method from another service. [ESPO Upgrade 6.1.0 -> 7.0.10]
Previously I was doing:
From Contact service:
Code:$this->getRecordService('ClientDetail')->update($clientDetailEntity->id, $clientDetails);
But since getRecordService method is deprecated, how do I call the functions from another service? Do I have to import the class and call the method?
There is no documentation regarding this anywhere.
telecastg item Any help would be appreciated.Tags: None
Leave a comment: