From 6b50f2cd82d8df3d8514edef4db594ec2d550699 Mon Sep 17 00:00:00 2001 From: Nobuo Kihara Date: Wed, 27 Apr 2016 22:06:37 +0900 Subject: [PATCH 1/3] docs/guide-ja updated [skip ci] (#11433) --- docs/guide-ja/db-active-record.md | 5 +++++ docs/guide-ja/db-migrations.md | 2 +- docs/guide-ja/rest-authentication.md | 2 +- docs/guide-ja/runtime-routing.md | 2 ++ docs/guide-ja/security-authorization.md | 3 +++ docs/guide-ja/structure-applications.md | 2 ++ docs/guide-ja/tutorial-console.md | 2 +- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/guide-ja/db-active-record.md b/docs/guide-ja/db-active-record.md index 1f871b6482..9c746ec50f 100644 --- a/docs/guide-ja/db-active-record.md +++ b/docs/guide-ja/db-active-record.md @@ -527,6 +527,11 @@ Customer::deleteAll(['status' => Customer::STATUS_INACTIVE]); > - [[yii\db\ActiveRecord::updateCounters()]] > - [[yii\db\ActiveRecord::updateAllCounters()]] +### データをリフレッシュする際のライフサイクル + +[[yii\db\ActiveRecord::refresh()|refresh()]] を呼んでアクティブレコードインスタンスをリフレッシュする際は、リフレッシュが成功してメソッドが `true` を返すと +[[yii\db\ActiveRecord::EVENT_AFTER_REFRESH|EVENT_AFTER_REFRESH]] イベントがトリガされます。 + ## トランザクションを扱う diff --git a/docs/guide-ja/db-migrations.md b/docs/guide-ja/db-migrations.md index 63365bc238..fcf10c5c88 100644 --- a/docs/guide-ja/db-migrations.md +++ b/docs/guide-ja/db-migrations.md @@ -407,7 +407,7 @@ class m160328_040430_create_post extends Migration パラメータが渡されなかった場合は、テーブル名はカラム名から推測されます。 上記の例で `author_id:integer:notNull:foreignKey(user)` は、`user` テーブルへの外部キーを持つ `author_id` という名前のカラムを生成します。 -一方、`category_id:integer:default(1):foreignKey` は、`category` テーブルへの外部キーを持つ `category_id` というカラムを生成します。 +一方、`category_id:integer:defaultValue(1):foreignKey` は、`category` テーブルへの外部キーを持つ `category_id` というカラムを生成します。 ### テーブルを削除する diff --git a/docs/guide-ja/rest-authentication.md b/docs/guide-ja/rest-authentication.md index 503e41fbb6..e2f7caab3e 100644 --- a/docs/guide-ja/rest-authentication.md +++ b/docs/guide-ja/rest-authentication.md @@ -110,5 +110,5 @@ class User extends ActiveRecord implements IdentityInterface ユーザが認証された後、おそらくは、リクエストされたリソースに対してリクエストされたアクションを実行する許可を彼または彼女が持っているかどうかをチェックしたいでしょう。 *権限付与* と呼ばれるこのプロセスについては、[権限付与](security-authorization.md) のセクションで詳細に説明されています。 -あなたのコントローラが [[yii\rest\ActiveController]] から拡張したものである場合は、[[yii\rest\Controller::checkAccess()|checkAccess()]] メソッドをオーバーライドして権限付与のチェックを実行することが出来ます。 +あなたのコントローラが [[yii\rest\ActiveController]] から拡張したものである場合は、[[yii\rest\ActiveController::checkAccess()|checkAccess()]] メソッドをオーバーライドして権限付与のチェックを実行することが出来ます。 このメソッドが [[yii\rest\ActiveController]] によって提供されている内蔵のアクションから呼び出されます。 diff --git a/docs/guide-ja/runtime-routing.md b/docs/guide-ja/runtime-routing.md index 550566a8b9..432aa2f643 100644 --- a/docs/guide-ja/runtime-routing.md +++ b/docs/guide-ja/runtime-routing.md @@ -109,6 +109,8 @@ $url = Url::to(['post/view', 'id' => 100]); `catchAll` プロパティは配列を取り、最初の要素はルートを指定し、残りの要素 (「名前-値」のペア) は [アクションのパラメータ](structure-controllers.md#action-parameters) を指定するものでなければなりません。 +> Info: このプロパティを有効にすると、開発環境でデバッグパネルが動作しなくなります。 + ## URL を生成する diff --git a/docs/guide-ja/security-authorization.md b/docs/guide-ja/security-authorization.md index 74b16cd925..3f8e9dee4f 100644 --- a/docs/guide-ja/security-authorization.md +++ b/docs/guide-ja/security-authorization.md @@ -305,6 +305,9 @@ class RbacController extends Controller } ``` +> Note: アドバンストテンプレートを使おうとするときは、`RbacController` を `console/controllers` +ディレクトリの中に置いて、名前空間を `console/controllers` に変更する必要があります。 + `yii rbac/init` によってコマンドを実行した後には、次の権限階層が得られます。 ![単純な RBAC 階層](images/rbac-hierarchy-1.png "単純な RBAC 階層") diff --git a/docs/guide-ja/structure-applications.md b/docs/guide-ja/structure-applications.md index 3c7442e999..2c9721b0e0 100644 --- a/docs/guide-ja/structure-applications.md +++ b/docs/guide-ja/structure-applications.md @@ -182,6 +182,8 @@ if (YII_ENV_DEV) { ] ``` +> Info: このプロパティを有効にすると、開発環境でデバッグパネルが動作しなくなります。 + #### [[yii\base\Application::components|components]] diff --git a/docs/guide-ja/tutorial-console.md b/docs/guide-ja/tutorial-console.md index e4709dc24a..5f907b2427 100644 --- a/docs/guide-ja/tutorial-console.md +++ b/docs/guide-ja/tutorial-console.md @@ -160,7 +160,7 @@ class HelloController extends Controller これで、次の構文を使ってコマンドを走らせることが出来るようになります。 ``` -./yii hello -m=hola +./yii hello -m=hello ``` ### 引数 From 7c663debd5de7f247e87623d2bd324c24991c4dc Mon Sep 17 00:00:00 2001 From: Evgeniy Tkachenko Date: Wed, 27 Apr 2016 16:43:40 +0300 Subject: [PATCH 2/3] [ci skip] phpDoc updated (#11434) --- framework/console/controllers/MigrateController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/console/controllers/MigrateController.php b/framework/console/controllers/MigrateController.php index 8c1c363332..7bcc43bcb9 100644 --- a/framework/console/controllers/MigrateController.php +++ b/framework/console/controllers/MigrateController.php @@ -92,8 +92,14 @@ class MigrateController extends BaseMigrateController /** * @var array column definition strings used for creating migration code. - * The format of each definition is `COLUMN_NAME:COLUMN_TYPE:COLUMN_DECORATOR`. - * For example, `--fields=name:string(12):notNull` produces a string column of size 12 which is not null. + * + * The format of each definition is `COLUMN_NAME:COLUMN_TYPE:COLUMN_DECORATOR`. Delimiter is `,`. + * For example, `--fields="name:string(12):notNull:unique"` + * produces a string column of size 12 which is not null and unique values. + * + * Note: primary key is added automatically and is named id by default. + * If you want to use another name you may specify it explicitly like + * `--fields="id_key:primaryKey,name:string(12):notNull:unique"` * @since 2.0.7 */ public $fields = []; From 72eca59399a709407dbe831fbf4a2b89c357414a Mon Sep 17 00:00:00 2001 From: Evgeniy Tkachenko Date: Wed, 27 Apr 2016 16:44:26 +0300 Subject: [PATCH 3/3] [ci skip] add note about create_xxx drop_xxx (#11435) --- framework/console/controllers/BaseMigrateController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/console/controllers/BaseMigrateController.php b/framework/console/controllers/BaseMigrateController.php index 36eda056bc..11218a459f 100644 --- a/framework/console/controllers/BaseMigrateController.php +++ b/framework/console/controllers/BaseMigrateController.php @@ -467,6 +467,11 @@ abstract class BaseMigrateController extends Controller * * @param string $name the name of the new migration. This should only contain * letters, digits and/or underscores. + * + * Note: If the migration name is of a special form, for example create_xxx or + * drop_xxx then the generated migration file will contain extra code, + * in this case for creating/dropping tables. + * * @throws Exception if the name argument is invalid. */ public function actionCreate($name)