type fixes

This commit is contained in:
Yuri Kuznetsov
2022-03-14 13:20:13 +02:00
parent fdc9a98c1d
commit bb2259232e
4 changed files with 7 additions and 2 deletions

View File

@@ -457,6 +457,7 @@ class Email extends Database implements
$entity->get('parentId') &&
$entity->isAttributeChanged('parentId')
) {
/** @var \Espo\ORM\Collection<EmailEntity> */
$replyList = $this->findRelated($entity, 'replies');
foreach ($replyList as $reply) {

View File

@@ -85,6 +85,7 @@ class Import extends Database
return $query;
}
/** @var \Espo\ORM\Query\SelectBuilder */
$builder = $this->entityManager->getQueryBuilder()->clone($query);
$builder->join(

View File

@@ -146,7 +146,9 @@ class Preferences implements Repository,
return;
}
/** @var array<string,array<string,mixed>> */
$fields = $this->metadata->get('entityDefs.Preferences.fields');
$defaults = [];
$dashboardLayout = $this->config->get('dashboardLayout');

View File

@@ -34,6 +34,7 @@ use Espo\ORM\Entity;
use Espo\Core\Exceptions\Error;
use Espo\Core\Exceptions\Conflict;
use Espo\Core\Repositories\Database;
use Espo\Core\Utils\Json;
use Espo\Repositories\UserData as UserDataRepository;
use Espo\Entities\UserData;
@@ -104,7 +105,7 @@ class User extends Database
if ($user) {
$this->entityManager->getLocker()->rollback();
throw new Conflict(json_encode(['reason' => 'userNameExists']));
throw new Conflict(Json::encode(['reason' => 'userNameExists']));
}
} else {
if ($entity->isAttributeChanged('userName')) {
@@ -127,7 +128,7 @@ class User extends Database
if ($user) {
$this->entityManager->getLocker()->rollback();
throw new Conflict(json_encode(['reason' => 'userNameExists']));
throw new Conflict(Json::encode(['reason' => 'userNameExists']));
}
}
}