@@ -278,9 +278,7 @@ protected function resolveProperty(
278
278
if ($ property ->isRefPointerToSelf ()) {
279
279
$ relation ->asSelfReference ();
280
280
}
281
- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
282
281
$ this ->relations [$ property ->getName ()] = $ relation ;
283
- // }
284
282
if (!$ property ->isRefPointerToSelf ()) {
285
283
$ this ->addInverseRelation ($ relatedClassName , $ attribute , $ property , $ fkProperty );
286
284
}
@@ -323,25 +321,21 @@ protected function resolveProperty(
323
321
$ fkProperty ->getName (),
324
322
'_id '
325
323
)) {
326
- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
327
324
$ this ->relations [$ property ->getName ()] =
328
325
Yii::createObject (
329
326
AttributeRelation::class,
330
327
[static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
331
328
)
332
329
->asHasMany ([$ fkProperty ->getName () => $ fkProperty ->getName ()])->asSelfReference ();
333
- // }
334
330
return ;
335
331
}
336
332
$ foreignPk = Inflector::camel2id ($ fkProperty ->getName (), '_ ' ) . '_id ' ;
337
- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
338
333
$ this ->relations [$ property ->getName ()] =
339
334
Yii::createObject (
340
335
AttributeRelation::class,
341
336
[static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
342
337
)
343
338
->asHasMany ([$ foreignPk => $ this ->componentSchema ->getPkName ()]);
344
- // }
345
339
return ;
346
340
}
347
341
$ relatedClassName = $ property ->getRefClassName ();
@@ -355,15 +349,13 @@ protected function resolveProperty(
355
349
return ;
356
350
}
357
351
$ attribute ->setPhpType ($ relatedClassName . '[] ' );
358
- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
359
352
$ this ->relations [$ property ->getName ()] =
360
353
Yii::createObject (
361
354
AttributeRelation::class,
362
355
[static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
363
356
)
364
357
->asHasMany ([Inflector::camel2id ($ this ->schemaName , '_ ' ) . '_id ' => $ this ->componentSchema ->getPkName ()])
365
358
->setInverse (Inflector::variablize ($ this ->schemaName ));
366
- // }
367
359
return ;
368
360
}
369
361
if ($ this ->componentSchema ->isNonDb () && $ attribute ->isReference ()) {
0 commit comments