@@ -278,9 +278,7 @@ protected function resolveProperty(
278278 if ($ property ->isRefPointerToSelf ()) {
279279 $ relation ->asSelfReference ();
280280 }
281- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
282281 $ this ->relations [$ property ->getName ()] = $ relation ;
283- // }
284282 if (!$ property ->isRefPointerToSelf ()) {
285283 $ this ->addInverseRelation ($ relatedClassName , $ attribute , $ property , $ fkProperty );
286284 }
@@ -323,25 +321,21 @@ protected function resolveProperty(
323321 $ fkProperty ->getName (),
324322 '_id '
325323 )) {
326- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
327324 $ this ->relations [$ property ->getName ()] =
328325 Yii::createObject (
329326 AttributeRelation::class,
330327 [static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
331328 )
332329 ->asHasMany ([$ fkProperty ->getName () => $ fkProperty ->getName ()])->asSelfReference ();
333- // }
334330 return ;
335331 }
336332 $ foreignPk = Inflector::camel2id ($ fkProperty ->getName (), '_ ' ) . '_id ' ;
337- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
338333 $ this ->relations [$ property ->getName ()] =
339334 Yii::createObject (
340335 AttributeRelation::class,
341336 [static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
342337 )
343338 ->asHasMany ([$ foreignPk => $ this ->componentSchema ->getPkName ()]);
344- // }
345339 return ;
346340 }
347341 $ relatedClassName = $ property ->getRefClassName ();
@@ -355,15 +349,13 @@ protected function resolveProperty(
355349 return ;
356350 }
357351 $ attribute ->setPhpType ($ relatedClassName . '[] ' );
358- // if (empty($property->getAttr(CustomSpecAttr::NO_RELATION))) {
359352 $ this ->relations [$ property ->getName ()] =
360353 Yii::createObject (
361354 AttributeRelation::class,
362355 [static ::relationName ($ property ->getName (), $ property ->fkColName ), $ relatedTableName , $ relatedClassName ]
363356 )
364357 ->asHasMany ([Inflector::camel2id ($ this ->schemaName , '_ ' ) . '_id ' => $ this ->componentSchema ->getPkName ()])
365358 ->setInverse (Inflector::variablize ($ this ->schemaName ));
366- // }
367359 return ;
368360 }
369361 if ($ this ->componentSchema ->isNonDb () && $ attribute ->isReference ()) {
0 commit comments