Skip to content

Commit 9fc8a2d

Browse files
authored
japanese doc translation updated (#20237)
1 parent 0d0f775 commit 9fc8a2d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/guide-ja/db-active-record.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,16 @@ Customer::deleteAll(['status' => Customer::STATUS_INACTIVE]);
650650
> - [[yii\db\ActiveRecord::updateCounters()]]
651651
> - [[yii\db\ActiveRecord::updateAllCounters()]]
652652
653+
> Note: パフォーマンスを考慮して、DI(依存注入) はデフォルトではサポートされていません。必要であれば、
654+
> [[Yii::createObject()]] によってクラスのインスタンス生成をするように [[yii\db\ActiveRecord::instantiate()|instantiate()]] メソッドをオーバーライドして、サポートを追加することが出来ます。
655+
>
656+
> ```php
657+
> public static function instantiate($row)
658+
> {
659+
> return Yii::createObject(static::class);
660+
> }
661+
> ```
662+
653663
### データをリフレッシュする際のライフサイクル <span id="refreshing-data-life-cycle"></span>
654664
655665
[[yii\db\ActiveRecord::refresh()|refresh()]] を呼んでアクティブ・レコード・インスタンスをリフレッシュする際は、リフレッシュが成功してメソッドが `true` を返すと

0 commit comments

Comments
 (0)