Hello,
I know its not good practice to access entityManager in a controller but I'm wondering what is the suggested way to do so? It seems $this->entityManager is deprecated in Controller in my version of Espo.
I know its not good practice to access entityManager in a controller but I'm wondering what is the suggested way to do so? It seems $this->entityManager is deprecated in Controller in my version of Espo.
PHP Code:
namespace Espo\Custom\Controllers;
use Espo\Core\{
Exceptions\BadRequest,
Api\Request,
Api\Response,
Exceptions\ForbiddenSilent,
ORM\Entity
};
use stdClass;
class MyCustomController extends \Espo\Core\Templates\Controllers\Base
{
public function postActionMyCustomAction(Request $request, Response $response): ?stdClass
{
$this->entityManager //deprecated ?
}
}
Comment