diff --git a/application/Espo/ORM/CollectionFactory.php b/application/Espo/ORM/CollectionFactory.php index 950b47f5df..4657b9946b 100644 --- a/application/Espo/ORM/CollectionFactory.php +++ b/application/Espo/ORM/CollectionFactory.php @@ -38,6 +38,9 @@ use Espo\ORM\{ */ class CollectionFactory { + /** + * @var EntityManager + */ protected $entityManager; public function __construct(EntityManager $entityManager) diff --git a/application/Espo/ORM/Mapper/BaseMapper.php b/application/Espo/ORM/Mapper/BaseMapper.php index b58de0489b..a8b26f77d6 100644 --- a/application/Espo/ORM/Mapper/BaseMapper.php +++ b/application/Espo/ORM/Mapper/BaseMapper.php @@ -61,20 +61,39 @@ class BaseMapper implements RDBMapper protected $aliasesCache = []; + /** + * @var PDO + */ protected $pdo; - protected $entityFactroy; - - protected $collectionFactory; - - protected $queryComposer; - + /** + * @var EntityFactory + */ protected $entityFactory; + /** + * @var CollectionFactory + */ + protected $collectionFactory; + + /** + * @var QueryComposer + */ + protected $queryComposer; + + /** + * @var Metadata + */ protected $metadata; + /** + * @var SqlExecutor + */ protected $sqlExecutor; + /** + * @var Helper + */ protected $helper; public function __construct( @@ -1237,7 +1256,7 @@ class BaseMapper implements RDBMapper { $id = $this->pdo->lastInsertId(); - if ($id === '' || $id === null) { + if ($id === '' || $id === null) { /** @phpstan-ignore-line */ return; } @@ -1560,7 +1579,7 @@ class BaseMapper implements RDBMapper $foreignEntity = $this->entityFactory->create($foreignEntityType); - $map = $foreignEntity->getRelationParam($foreign, 'columnAttributeMap') ?? []; + $map = $this->getRelationParam($foreignEntity, $foreign, 'columnAttributeMap') ?? []; $select = []; diff --git a/application/Espo/ORM/QueryComposer/BaseQueryComposer.php b/application/Espo/ORM/QueryComposer/BaseQueryComposer.php index 841bf017e7..644209d320 100644 --- a/application/Espo/ORM/QueryComposer/BaseQueryComposer.php +++ b/application/Espo/ORM/QueryComposer/BaseQueryComposer.php @@ -144,12 +144,24 @@ abstract class BaseQueryComposer implements QueryComposer protected $identifierQuoteCharacter = '`'; + /** + * @var EntityFactory + */ protected $entityFactory; + /** + * @var PDO + */ protected $pdo; + /** + * @var Metadata + */ protected $metadata; + /** + * @var FunctionConverterFactory|null + */ protected $functionConverterFactory; protected $helper; @@ -1070,7 +1082,7 @@ abstract class BaseQueryComposer implements QueryComposer return $function . '(' . $part . ')'; } - private function getFunctionPartFromFactory(string $function, array $argumentPartList): ?string + private function getFunctionPartFromFactory(string $function, array $argumentPartList): string { $obj = $this->functionConverterFactory->create($function); diff --git a/application/Espo/ORM/Repository/RDBRepository.php b/application/Espo/ORM/Repository/RDBRepository.php index 9d4b24190e..fa3ab590ff 100644 --- a/application/Espo/ORM/Repository/RDBRepository.php +++ b/application/Espo/ORM/Repository/RDBRepository.php @@ -61,12 +61,19 @@ class RDBRepository implements Repository */ protected $entityManager; + /** + * @var EntityFactory + */ protected $entityFactory; - protected $mapper; - + /** + * @var HookMediator|null + */ protected $hookMediator; + /** + * @var RDBTransactionManager + */ protected $transactionManager; public function __construct(