Skip to content

Commit 15d588a

Browse files
committed
Format
1 parent fe9b00a commit 15d588a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/lib/AttributeResolver.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,20 +322,20 @@ protected function resolveProperty(
322322
'_id'
323323
)) {
324324
$this->relations[$property->getName()] =
325-
Yii::createObject(
326-
AttributeRelation::class,
327-
[static::relationName($property->getName(), $property->fkColName), $relatedTableName, $relatedClassName]
328-
)
329-
->asHasMany([$fkProperty->getName() => $fkProperty->getName()])->asSelfReference();
330-
return;
331-
}
332-
$foreignPk = Inflector::camel2id($fkProperty->getName(), '_') . '_id';
333-
$this->relations[$property->getName()] =
334325
Yii::createObject(
335326
AttributeRelation::class,
336327
[static::relationName($property->getName(), $property->fkColName), $relatedTableName, $relatedClassName]
337328
)
338-
->asHasMany([$foreignPk => $this->componentSchema->getPkName()]);
329+
->asHasMany([$fkProperty->getName() => $fkProperty->getName()])->asSelfReference();
330+
return;
331+
}
332+
$foreignPk = Inflector::camel2id($fkProperty->getName(), '_') . '_id';
333+
$this->relations[$property->getName()] =
334+
Yii::createObject(
335+
AttributeRelation::class,
336+
[static::relationName($property->getName(), $property->fkColName), $relatedTableName, $relatedClassName]
337+
)
338+
->asHasMany([$foreignPk => $this->componentSchema->getPkName()]);
339339
return;
340340
}
341341
$relatedClassName = $property->getRefClassName();

0 commit comments

Comments
 (0)