Skip to content

Commit

Permalink
ObjectSuggestions: Remove superflous code
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Oct 23, 2023
1 parent a98cf0d commit 564d17b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ public static function collectFilterColumns(Model $model, Resolver $resolver): T
self::collectRelations($resolver, $model, $models, []);

foreach ($models as $path => $targetModel) {
/** @var Model $targetModel */
foreach ($resolver->getColumnDefinitions($targetModel) as $columnName => $definition) {
yield $path . '.' . $columnName => $definition->getLabel();
}
Expand All @@ -195,7 +194,7 @@ protected static function collectRelations(Resolver $resolver, Model $subject, a
$isHasOne = $relation instanceof HasOne;
if (empty($path)) {
$relationPath = [$name];
if ($isHasOne && empty($path)) {
if ($isHasOne) {
array_unshift($relationPath, $subject->getTableName());
}

Expand Down

0 comments on commit 564d17b

Please sign in to comment.