Skip to content

Commit d07b51b

Browse files
committed
some protected members added
1 parent 87fd8ca commit d07b51b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Base/QueryRelationManagerBase.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ abstract class QueryRelationManagerBase
1616
*/
1717
protected $query;
1818

19+
/**
20+
* @var string имя основного класса ORM-модели запроса
21+
*/
22+
protected $mainClassName;
23+
1924
/**
2025
* @var string псевдоним основной таблицы запроса
2126
*/
@@ -41,6 +46,11 @@ abstract class QueryRelationManagerBase
4146
*/
4247
protected $modifierMap = [];
4348

49+
/**
50+
* @var string[] карта псевдонимов таблиц по именам классов
51+
*/
52+
protected $mapClassNameToTableAlias = [];
53+
4454
/**
4555
* @var string[] карта имен подключаемых таблиц по их псевдонимам
4656
*/
@@ -433,6 +443,7 @@ abstract protected function createQuery(): QueryWrapperInterface;
433443
*/
434444
protected function __construct(string $className, string $alias, string $fieldJoinTo, string $primaryFieldName = 'id')
435445
{
446+
$this->mainClassName = $className;
436447
$this->mainTableAlias = $alias;
437448
$this->mainTableName = $this->getTableName($className);
438449
$this->mainTableField = $fieldJoinTo;
@@ -455,6 +466,8 @@ protected function addAliases(
455466
?string $fieldJoinBy = null, ?string $containerFieldAlias = null
456467
): self
457468
{
469+
$this->mapClassNameToTableAlias[$className] = $joinAs;
470+
458471
$tableName = $this->getTableName($className);
459472

460473
if(isset($this->mapJoinAsToTableName[$joinAs])) {

0 commit comments

Comments
 (0)