diff --git a/application/Espo/Core/Portal/Application.php b/application/Espo/Core/Portal/Application.php index dcf39180b7..e2b3e208f5 100644 --- a/application/Espo/Core/Portal/Application.php +++ b/application/Espo/Core/Portal/Application.php @@ -45,6 +45,8 @@ use Espo\Core\{ class Application extends BaseApplication { + private $portal; + public function __construct(?string $portalId) { date_default_timezone_set('UTC'); diff --git a/application/Espo/Core/Record/Service.php b/application/Espo/Core/Record/Service.php index a8e69e199f..9eadb770c5 100644 --- a/application/Espo/Core/Record/Service.php +++ b/application/Espo/Core/Record/Service.php @@ -69,7 +69,7 @@ use Espo\Core\{ use Espo\Core\Di; -use StdClass; +use stdClass; use RuntimeException; /** @@ -434,7 +434,7 @@ class Service implements Crud, } } - public function filterCreateInput(StdClass $data): void + public function filterCreateInput(stdClass $data): void { unset($data->deleted); unset($data->id); @@ -452,7 +452,7 @@ class Service implements Crud, $this->handleCreateInput($data); } - public function filterUpdateInput(StdClass $data): void + public function filterUpdateInput(stdClass $data): void { unset($data->deleted); unset($data->id); @@ -483,7 +483,7 @@ class Service implements Crud, { } - protected function processConcurrencyControl(Entity $entity, StdClass $data, int $versionNumber): void + protected function processConcurrencyControl(Entity $entity, stdClass $data, int $versionNumber): void { if ($entity->get('versionNumber') === null) { return; @@ -521,7 +521,7 @@ class Service implements Crud, throw ConflictSilent::createWithBody('modified', json_encode($responseData)); } - protected function processDuplicateCheck(Entity $entity, StdClass $data): void + protected function processDuplicateCheck(Entity $entity, stdClass $data): void { $duplicateList = $this->findDuplicates($entity, $data); @@ -538,7 +538,7 @@ class Service implements Crud, throw ConflictSilent::createWithBody('duplicate', json_encode($list)); } - public function populateDefaults(Entity $entity, StdClass $data): void + public function populateDefaults(Entity $entity, stdClass $data): void { if (!$this->user->isPortal()) { $forbiddenFieldList = null; @@ -598,7 +598,7 @@ class Service implements Crud, * * @throws ForbiddenSilent If no create access. */ - public function create(StdClass $data, CreateParams $params): Entity + public function create(stdClass $data, CreateParams $params): Entity { if (!$this->acl->check($this->entityType, AclTable::ACTION_CREATE)) { throw new ForbiddenSilent(); @@ -646,7 +646,7 @@ class Service implements Crud, * @throws NotFound If record not found. * @throws Forbidden If no access. */ - public function update(string $id, StdClass $data, UpdateParams $params): Entity + public function update(string $id, stdClass $data, UpdateParams $params): Entity { if (!$this->acl->check($this->entityType, AclTable::ACTION_EDIT)) { throw new ForbiddenSilent(); @@ -1502,7 +1502,7 @@ class Service implements Crud, return $this->getStreamService()->findEntityFollowers($entity, $params); } - public function getDuplicateAttributes(string $id): StdClass + public function getDuplicateAttributes(string $id): stdClass { if (!$id) { throw new BadRequest("No ID."); diff --git a/application/Espo/Core/Select/Where/ItemGeneralConverter.php b/application/Espo/Core/Select/Where/ItemGeneralConverter.php index a2343919bb..c1b29af5cc 100644 --- a/application/Espo/Core/Select/Where/ItemGeneralConverter.php +++ b/application/Espo/Core/Select/Where/ItemGeneralConverter.php @@ -941,7 +941,7 @@ class ItemGeneralConverter implements ItemConverter $dtToday = new DateTime(); $dt = new DateTime(); - $fiscalYearShift = $this->getConfig()->get('fiscalYearShift', 0); + $fiscalYearShift = $this->config->get('fiscalYearShift', 0); $dt->modify('first day of January this year')->modify('+' . $fiscalYearShift . ' months'); @@ -971,7 +971,7 @@ class ItemGeneralConverter implements ItemConverter $dtToday = new DateTime(); $dt = new DateTime(); - $fiscalYearShift = $this->getConfig()->get('fiscalYearShift', 0); + $fiscalYearShift = $this->config->get('fiscalYearShift', 0); $dt->modify('first day of January this year')->modify('+' . $fiscalYearShift . ' months'); diff --git a/application/Espo/Services/Attachment.php b/application/Espo/Services/Attachment.php index 23d86179ea..99241783f6 100644 --- a/application/Espo/Services/Attachment.php +++ b/application/Espo/Services/Attachment.php @@ -36,7 +36,7 @@ use Espo\Core\Exceptions\Forbidden; use Espo\Core\Exceptions\Error; use Espo\Core\Exceptions\NotFound; -use StdClass; +use stdClass; class Attachment extends Record { @@ -88,7 +88,7 @@ class Attachment extends Record } } - public function filterUpdateInput(StdClass $data): void + public function filterUpdateInput(stdClass $data): void { parent::filterUpdateInput($data); @@ -99,7 +99,7 @@ class Attachment extends Record unset($data->relatedType); } - public function filterCreateInput(StdClass $data): void + public function filterCreateInput(stdClass $data): void { parent::filterCreateInput($data); @@ -460,7 +460,7 @@ class Attachment extends Record ]; } - public function getFileData(string $id): StdClass + public function getFileData(string $id): stdClass { $attachment = $this->getEntity($id); diff --git a/application/Espo/Services/AuthToken.php b/application/Espo/Services/AuthToken.php index cc8418b0a8..d6d681d88f 100644 --- a/application/Espo/Services/AuthToken.php +++ b/application/Espo/Services/AuthToken.php @@ -29,13 +29,13 @@ namespace Espo\Services; -use StdClass; +use stdClass; class AuthToken extends Record { protected $actionHistoryDisabled = true; - public function filterUpdateInput(StdClass $data): void + public function filterUpdateInput(stdClass $data): void { parent::filterUpdateInput($data); diff --git a/application/Espo/Services/Webhook.php b/application/Espo/Services/Webhook.php index 330cbf08a2..ecd06aacff 100644 --- a/application/Espo/Services/Webhook.php +++ b/application/Espo/Services/Webhook.php @@ -35,7 +35,7 @@ use Espo\Core\Exceptions\Forbidden; use Espo\Core\Di; -use StdClass; +use stdClass; class Webhook extends Record implements Di\WebhookManagerAware @@ -56,7 +56,7 @@ class Webhook extends Record implements protected $readOnlyAttributeList = ['secretKey']; - public function populateDefaults(Entity $entity, StdClass $data): void + public function populateDefaults(Entity $entity, stdClass $data): void { parent::populateDefaults($entity, $data); @@ -74,7 +74,7 @@ class Webhook extends Record implements unset($data->type); } - public function filterUpdateInput(StdClass $data): void + public function filterUpdateInput(stdClass $data): void { if (!$this->getUser()->isAdmin()) { unset($data->event);