mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
docs/guide-ja updated [skip ci] (#13342)
* docs/guide-ja/caching-data.md updated * docs/guide-ja/caching-fragment.md updated * docs/guide-ja/concept-configurations.md updated * WIP * docs/guide-ja/concept-di-container.md updated * docs/guide-ja/db-active-record.md updating WIP * docs/guide-ja/db-active-record.md updated * docs/guide-ja updating (WIP) [skip ci]
This commit is contained in:
committed by
Alexander Makarov
parent
b113ad460a
commit
92270bcd24
@@ -88,7 +88,7 @@ if (!ArrayHelper::keyExists('username', $data1, false) || !ArrayHelper::keyExist
|
||||
良くある例は、ID のリストの取得です。
|
||||
|
||||
```php
|
||||
$data = [
|
||||
$array = [
|
||||
['id' => '123', 'data' => 'abc'],
|
||||
['id' => '345', 'data' => 'def'],
|
||||
];
|
||||
@@ -114,7 +114,7 @@ $result = ArrayHelper::getColumn($array, function ($element) {
|
||||
|
||||
`$groups` 属性はキーの配列であり、入力値の配列を一つまたは複数のサブ配列にグループ化するために使用されます。
|
||||
|
||||
特定の要素の `$key` 属性またはその値が null であるとき、`$groups` が定義されていない場合は、その要素は破棄されて、結果には入りません。
|
||||
特定の要素の `$key` 属性またはその値が `null` であるとき、`$groups` が定義されていない場合は、その要素は破棄されて、結果には入りません。
|
||||
そうではなく、`$groups` が指定されている場合は、配列の要素はキー無しで結果の配列に追加されます。
|
||||
|
||||
例えば、
|
||||
@@ -398,7 +398,7 @@ $data = ArrayHelper::toArray($posts, [
|
||||
- キー/値 のペア - 配列のキー名にしたい文字列と、値を取得すべきモデルのカラムの名前。
|
||||
- キー/値 のペア - 配列のキー名にしたい文字列と、値を返すコールバック。
|
||||
|
||||
変換の結果は以下のようになります。
|
||||
単一のモデルに対する上記の変換の結果は以下のようになります。
|
||||
|
||||
|
||||
```php
|
||||
|
||||
Reference in New Issue
Block a user