diff --git a/application/Espo/Services/EmailTemplate.php b/application/Espo/Services/EmailTemplate.php index 9a98e3b76f..c3bfb1836c 100644 --- a/application/Espo/Services/EmailTemplate.php +++ b/application/Espo/Services/EmailTemplate.php @@ -50,6 +50,7 @@ class EmailTemplate extends Record implements /** * @deprecated For bc. Use `Espo\Tools\EmailTemplate\Processor`. + * @todo Remove in v9.0. * * @param array $params * @return array{ @@ -96,6 +97,7 @@ class EmailTemplate extends Record implements /** * @deprecated For bc. Use `Espo\Tools\EmailTemplate\Service`. + * @todo Remove in v9.0. * * @param array $params * @return array diff --git a/application/Espo/Services/Integration.php b/application/Espo/Services/Integration.php index c8bf7e6e1e..3ba808dfd1 100644 --- a/application/Espo/Services/Integration.php +++ b/application/Espo/Services/Integration.php @@ -33,6 +33,7 @@ use Espo\Core\Exceptions\Forbidden; use Espo\Core\Exceptions\NotFound; use Espo\Core\Utils\Config; use Espo\Core\Utils\Config\ConfigWriter; +use Espo\Entities\Integration as IntegrationEntity; use Espo\Entities\User; use Espo\ORM\Entity; use Espo\ORM\EntityManager; @@ -41,29 +42,12 @@ use stdClass; class Integration { - /** @var EntityManager */ - protected $entityManager; - - /** @var User */ - protected $user; - - /** @var Config */ - protected $config; - - /** @var ConfigWriter */ - protected $configWriter; - public function __construct( - EntityManager $entityManager, - User $user, - Config $config, - ConfigWriter $configWriter - ) { - $this->entityManager = $entityManager; - $this->user = $user; - $this->config = $config; - $this->configWriter = $configWriter; - } + private EntityManager $entityManager, + private User $user, + private Config $config, + private ConfigWriter $configWriter + ) {} /** * @return void @@ -84,7 +68,7 @@ class Integration { $this->processAccessCheck(); - $entity = $this->entityManager->getEntity('Integration', $id); + $entity = $this->entityManager->getEntityById(IntegrationEntity::ENTITY_TYPE, $id); if (!$entity) { throw new NotFound(); @@ -101,7 +85,7 @@ class Integration { $this->processAccessCheck(); - $entity = $this->entityManager->getEntity('Integration', $id); + $entity = $this->entityManager->getEntityById(IntegrationEntity::ENTITY_TYPE, $id); if (!$entity) { throw new NotFound(); @@ -111,18 +95,15 @@ class Integration $this->entityManager->saveEntity($entity); - $integrationsConfigData = $this->config->get('integrations') ?? (object) []; + $configData = $this->config->get('integrations') ?? (object) []; - if (!($integrationsConfigData instanceof stdClass)) { - $integrationsConfigData = (object) []; + if (!$configData instanceof stdClass) { + $configData = (object) []; } - $integrationName = $id; - - $integrationsConfigData->$integrationName = $entity->get('enabled'); - - $this->configWriter->set('integrations', $integrationsConfigData); + $configData->$id = $entity->get('enabled'); + $this->configWriter->set('integrations', $configData); $this->configWriter->save(); return $entity; diff --git a/application/Espo/Services/Pdf.php b/application/Espo/Services/Pdf.php index 2d3601bfee..2e7931b52c 100644 --- a/application/Espo/Services/Pdf.php +++ b/application/Espo/Services/Pdf.php @@ -31,7 +31,6 @@ namespace Espo\Services; use Espo\Core\Exceptions\NotFound; use Espo\ORM\Entity; - use Espo\Core\Exceptions\Error; use Espo\Core\Exceptions\Forbidden; use Espo\Tools\Pdf\Data; @@ -41,7 +40,7 @@ use Espo\Entities\Template; /** * @deprecated Left for bc. - * @todo Remove in v10.0. + * @todo Remove in v9.0. */ class Pdf { @@ -54,6 +53,7 @@ class Pdf } /** + * @deprecated * @throws Error * @throws Forbidden */ @@ -74,7 +74,7 @@ class Pdf * @throws Forbidden * @throws NotFound * - * @deprecated Left for bc. + * @deprecated */ public function buildFromTemplate( Entity $entity,