- Merged
This commit is contained in:
1 parent
2d86adc3e1
commit
1e4a528d39
4 files changed
+15
-17
No files matched your search
+6
-6
@@ -23,7 +23,7 @@ class Repository implements RepositoryInterface
|
||||
|
||||
public array $events = [];
|
||||
|
||||
public ? ConnectionAdapter $adapters;
|
||||
public ? ConnectionAdapter $adapter;
|
||||
|
||||
public readonly QueryBuilder\QueryBuilderInterface $queryBuilder;
|
||||
|
||||
@@ -31,7 +31,8 @@ class Repository implements RepositoryInterface
|
||||
|
||||
protected array $joined = [];
|
||||
|
||||
public function __construct(string $entity, string $alias = self::DEFAULT_ALIAS, ?ConnectionAdapter $adapter = null) {
|
||||
public function __construct(string $entity, string $alias = self::DEFAULT_ALIAS, null|ConnectionAdapter $adapter = null) {
|
||||
|
||||
$this->entityClass = $entity;
|
||||
$this->alias = $alias;
|
||||
$this->entityResolver = Ulmus::resolveEntity($entity);
|
||||
@@ -465,8 +466,8 @@ class Repository implements RepositoryInterface
|
||||
foreach(array_filter($fields, fn($e) => $e && ! isset($this->joined[$e]) ) as $item) {
|
||||
$this->joined[$item] = true;
|
||||
|
||||
$attribute = $this->entityResolver->searchFieldAnnotation($item, [ Join::class ]) ?:
|
||||
$this->entityResolver->searchFieldAnnotation($item, [ Relation::class ]);
|
||||
$attribute = clone ($this->entityResolver->searchFieldAnnotation($item, [ Join::class ]) ?:
|
||||
$this->entityResolver->searchFieldAnnotation($item, [ Relation::class ]));
|
||||
|
||||
$isRelation = $attribute instanceof Relation;
|
||||
|
||||
@@ -476,8 +477,7 @@ class Repository implements RepositoryInterface
|
||||
|
||||
if ( $attribute ) {
|
||||
$alias = $attribute->alias ?? $item;
|
||||
|
||||
$entity = $attribute->entity ?? $this->entityResolver->reflectedClass->getProperties(true)[$item]->getTypes()[0]->type;
|
||||
$entity = $attribute->entity ?? $this->entityResolver->getPropertyEntityType($item);
|
||||
|
||||
foreach($entity::resolveEntity()->fieldList(Common\EntityResolver::KEY_COLUMN_NAME, true) as $key => $field) {
|
||||
if ( null === $entity::resolveEntity()->searchFieldAnnotation($field->name, [ Relation\Ignore::class ]) ) {
|
||||
|
||||
Reference in new issue
Block a user