{"action":"created","comment":{"url":"https://api.github.com/repos/cakephp/docs/pulls/comments/70919849","id":70919849,"diff_hunk":"@@ -1,17 +1,137 @@\n-Timestamp Behavior\n-##################\n+Timestamp\n+#########\n \n .. php:namespace:: Cake\\ORM\\Behavior\n \n .. php:class:: TimestampBehavior\n \n-.. note::\n-    The documentation is not currently supported in Japanese language for this\n-    page.\n+..\n+    The timestamp behavior allows your table objects to update one or more\n+    timestamps on each model event. This is primarily used to populate data into\n+    ``created`` and ``modified`` fields. However, with some additional\n+    configuration, you can update any timestamp/datetime column on any event a table\n+    publishes.\n \n-    Please feel free to send us a pull request on\n-    `Github <https://github.com/cakephp/docs>`_ or use the **Improve This Doc**\n-    button to directly propose your changes.\n+TimestampビヘイビアはTableObjectを更新する度、もしくは各モデルのイベントのたびに許可し、 ``created`` や ``modified`` で使われています。\n+けれども、設定を追加すると、任意のtimestampとdatatimeカラムを任意のイベントで更新することができます。\n \n-    You can refer to the English version in the select top menu to have\n-    information about this page's topic.\n+..\n+    Basic Usage\n+\n+一般的な使い方\n+========================================================\n+\n+..\n+    You enable the timestamp behavior like any other behavior\n+\n+あなたは他のビヘイビアと同様に、timestampビヘイビアを以下の様に有効にできます。::\n+\n+    class ArticlesTable extends Table\n+    {\n+        public function initialize(array $config)\n+        {\n+            $this->addBehavior('Timestamp');\n+        }\n+    }\n+\n+..\n+    The default configuration will do the following:\n+\n+デフォルトの設定は以下のようになっています:\n+\n+..\n+    - When a new entity is saved the ``created`` and ``modified`` fields will be set to the current time.\n+    - When an entity is updated, the ``modified`` field is set to the current time.\n+\n+- 新しくEntityを保存するとき、 ``created`` と ``modified`` に現在の日時を設定します。\n+- Entityを更新したとき、 ``modified`` に現在の日時を設定します。\n+\n+..\n+    Using and Configuring the Behavior\n+\n+使い方と設定方法\n+========================================================\n+\n+\n+..\n+    If you need to modify fields with different names, or want to update additional timestamp fields on custom events you can use some additional configuration\n+\n+もしあなたが難しい名前のフィールドを修正したいときか、カスタムイベントで更新のtimestampを追加したフィールドを追加したいのであれば、以下設定を追加することにより可能となります。::\n+\n+    class OrdersTable extends Table\n+    {\n+        public function initialize(array $config)\n+        {\n+            $this->addBehavior('Timestamp', [\n+                'events' => [\n+                    'Model.beforeSave' => [\n+                        'created_at' => 'new',\n+                        'updated_at' => 'always',\n+                    ],\n+                    'Orders.completed' => [\n+                        'completed_at' => 'always'\n+                    ]\n+                ]\n+            ]);\n+        }\n+    }\n+\n+\n+..\n+    As you can see above, in addition to the standard ``Model.beforeSave`` event, we\n+    are also updating the ``completed_at`` column when orders are completed.\n+\n+ご覧の通り、一般的な ``Model.beforeSave`` イベントと同じように、 ``completed_at`` を追加し完了です。\n+\n+..\n+    Updating Timestamps on Entities\n+\n+EntityでのTimestamp更新\n+========================================================\n+\n+..\n+    Sometimes you'll want to update just the timestamps on an entity without\n+    changing any other properties. This is sometimes referred to as 'touching'\n+    a record. In CakePHP you can use the ``touch()`` method to do exactly this::\n+\n+他のEntityのPropertyが変わった時に、timestampを更新したい時のために、 'touching' に関して記述します。","path":"ja/orm/behaviors/timestamp.rst","position":107,"original_position":107,"commit_id":"747b59a5221f86ac2962843f197f5d4c4b60812a","original_commit_id":"747b59a5221f86ac2962843f197f5d4c4b60812a","user":{"login":"okinaka","id":120861,"avatar_url":"https://avatars.githubusercontent.com/u/120861?v=3","gravatar_id":"","url":"https://api.github.com/users/okinaka","html_url":"https://github.com/okinaka","followers_url":"https://api.github.com/users/okinaka/followers","following_url":"https://api.github.com/users/okinaka/following{/other_user}","gists_url":"https://api.github.com/users/okinaka/gists{/gist_id}","starred_url":"https://api.github.com/users/okinaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okinaka/subscriptions","organizations_url":"https://api.github.com/users/okinaka/orgs","repos_url":"https://api.github.com/users/okinaka/repos","events_url":"https://api.github.com/users/okinaka/events{/privacy}","received_events_url":"https://api.github.com/users/okinaka/received_events","type":"User","site_admin":false},"body":"> Sometimes you'll want to update just the timestamps on an entity without  changing any other properties.\r\n\r\n他のプロパティを変更せずに、エンティティのタイムスタンプのみ更新したいこともあるでしょう。\r\n\r\n> This is sometimes referred to as 'touching' a record.\r\n\r\nこれは、しばしば、レコードに「触れている」とみなされます。\r\n","created_at":"2016-07-15T04:20:23Z","updated_at":"2016-07-15T04:20:23Z","html_url":"https://github.com/cakephp/docs/pull/4175#discussion_r70919849","pull_request_url":"https://api.github.com/repos/cakephp/docs/pulls/4175","_links":{"self":{"href":"https://api.github.com/repos/cakephp/docs/pulls/comments/70919849"},"html":{"href":"https://github.com/cakephp/docs/pull/4175#discussion_r70919849"},"pull_request":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4175"}}},"pull_request":{"url":"https://api.github.com/repos/cakephp/docs/pulls/4175","id":77448416,"html_url":"https://github.com/cakephp/docs/pull/4175","diff_url":"https://github.com/cakephp/docs/pull/4175.diff","patch_url":"https://github.com/cakephp/docs/pull/4175.patch","issue_url":"https://api.github.com/repos/cakephp/docs/issues/4175","number":4175,"state":"open","locked":false,"title":"[WIP] Ja timestamp behavior","user":{"login":"ykeisuke","id":3081092,"avatar_url":"https://avatars.githubusercontent.com/u/3081092?v=3","gravatar_id":"","url":"https://api.github.com/users/ykeisuke","html_url":"https://github.com/ykeisuke","followers_url":"https://api.github.com/users/ykeisuke/followers","following_url":"https://api.github.com/users/ykeisuke/following{/other_user}","gists_url":"https://api.github.com/users/ykeisuke/gists{/gist_id}","starred_url":"https://api.github.com/users/ykeisuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ykeisuke/subscriptions","organizations_url":"https://api.github.com/users/ykeisuke/orgs","repos_url":"https://api.github.com/users/ykeisuke/repos","events_url":"https://api.github.com/users/ykeisuke/events{/privacy}","received_events_url":"https://api.github.com/users/ykeisuke/received_events","type":"User","site_admin":false},"body":"Working in progress.","created_at":"2016-07-14T12:33:42Z","updated_at":"2016-07-15T04:20:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a371e6114fe940591c95b7e451f4bc7767fb131","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/cakephp/docs/milestones/1","html_url":"https://github.com/cakephp/docs/milestones/3.x","labels_url":"https://api.github.com/repos/cakephp/docs/milestones/1/labels","id":629438,"number":1,"title":"3.x","description":"","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":31,"closed_issues":1786,"state":"open","created_at":"2014-04-14T15:44:13Z","updated_at":"2016-07-15T01:16:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/cakephp/docs/pulls/4175/commits","review_comments_url":"https://api.github.com/repos/cakephp/docs/pulls/4175/comments","review_comment_url":"https://api.github.com/repos/cakephp/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cakephp/docs/issues/4175/comments","statuses_url":"https://api.github.com/repos/cakephp/docs/statuses/747b59a5221f86ac2962843f197f5d4c4b60812a","head":{"label":"ykeisuke:trancelate_orm_behaviors_timestamp_ja","ref":"trancelate_orm_behaviors_timestamp_ja","sha":"747b59a5221f86ac2962843f197f5d4c4b60812a","user":{"login":"ykeisuke","id":3081092,"avatar_url":"https://avatars.githubusercontent.com/u/3081092?v=3","gravatar_id":"","url":"https://api.github.com/users/ykeisuke","html_url":"https://github.com/ykeisuke","followers_url":"https://api.github.com/users/ykeisuke/followers","following_url":"https://api.github.com/users/ykeisuke/following{/other_user}","gists_url":"https://api.github.com/users/ykeisuke/gists{/gist_id}","starred_url":"https://api.github.com/users/ykeisuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ykeisuke/subscriptions","organizations_url":"https://api.github.com/users/ykeisuke/orgs","repos_url":"https://api.github.com/users/ykeisuke/repos","events_url":"https://api.github.com/users/ykeisuke/events{/privacy}","received_events_url":"https://api.github.com/users/ykeisuke/received_events","type":"User","site_admin":false},"repo":{"id":49645049,"name":"docs","full_name":"ykeisuke/docs","owner":{"login":"ykeisuke","id":3081092,"avatar_url":"https://avatars.githubusercontent.com/u/3081092?v=3","gravatar_id":"","url":"https://api.github.com/users/ykeisuke","html_url":"https://github.com/ykeisuke","followers_url":"https://api.github.com/users/ykeisuke/followers","following_url":"https://api.github.com/users/ykeisuke/following{/other_user}","gists_url":"https://api.github.com/users/ykeisuke/gists{/gist_id}","starred_url":"https://api.github.com/users/ykeisuke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ykeisuke/subscriptions","organizations_url":"https://api.github.com/users/ykeisuke/orgs","repos_url":"https://api.github.com/users/ykeisuke/repos","events_url":"https://api.github.com/users/ykeisuke/events{/privacy}","received_events_url":"https://api.github.com/users/ykeisuke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ykeisuke/docs","description":"CakePHP CookBook","fork":true,"url":"https://api.github.com/repos/ykeisuke/docs","forks_url":"https://api.github.com/repos/ykeisuke/docs/forks","keys_url":"https://api.github.com/repos/ykeisuke/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ykeisuke/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ykeisuke/docs/teams","hooks_url":"https://api.github.com/repos/ykeisuke/docs/hooks","issue_events_url":"https://api.github.com/repos/ykeisuke/docs/issues/events{/number}","events_url":"https://api.github.com/repos/ykeisuke/docs/events","assignees_url":"https://api.github.com/repos/ykeisuke/docs/assignees{/user}","branches_url":"https://api.github.com/repos/ykeisuke/docs/branches{/branch}","tags_url":"https://api.github.com/repos/ykeisuke/docs/tags","blobs_url":"https://api.github.com/repos/ykeisuke/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ykeisuke/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ykeisuke/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ykeisuke/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ykeisuke/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ykeisuke/docs/languages","stargazers_url":"https://api.github.com/repos/ykeisuke/docs/stargazers","contributors_url":"https://api.github.com/repos/ykeisuke/docs/contributors","subscribers_url":"https://api.github.com/repos/ykeisuke/docs/subscribers","subscription_url":"https://api.github.com/repos/ykeisuke/docs/subscription","commits_url":"https://api.github.com/repos/ykeisuke/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ykeisuke/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ykeisuke/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ykeisuke/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ykeisuke/docs/contents/{+path}","compare_url":"https://api.github.com/repos/ykeisuke/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ykeisuke/docs/merges","archive_url":"https://api.github.com/repos/ykeisuke/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ykeisuke/docs/downloads","issues_url":"https://api.github.com/repos/ykeisuke/docs/issues{/number}","pulls_url":"https://api.github.com/repos/ykeisuke/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ykeisuke/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ykeisuke/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ykeisuke/docs/labels{/name}","releases_url":"https://api.github.com/repos/ykeisuke/docs/releases{/id}","deployments_url":"https://api.github.com/repos/ykeisuke/docs/deployments","created_at":"2016-01-14T12:09:03Z","updated_at":"2016-01-14T12:09:07Z","pushed_at":"2016-07-14T12:30:40Z","git_url":"git://github.com/ykeisuke/docs.git","ssh_url":"git@github.com:ykeisuke/docs.git","clone_url":"https://github.com/ykeisuke/docs.git","svn_url":"https://github.com/ykeisuke/docs","homepage":"http://book.cakephp.org","size":45712,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cakephp:3.0","ref":"3.0","sha":"61af8ca0f4bc4203bb3255b91aa8a664389002af","user":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"repo":{"id":1514950,"name":"docs","full_name":"cakephp/docs","owner":{"login":"cakephp","id":23666,"avatar_url":"https://avatars.githubusercontent.com/u/23666?v=3","gravatar_id":"","url":"https://api.github.com/users/cakephp","html_url":"https://github.com/cakephp","followers_url":"https://api.github.com/users/cakephp/followers","following_url":"https://api.github.com/users/cakephp/following{/other_user}","gists_url":"https://api.github.com/users/cakephp/gists{/gist_id}","starred_url":"https://api.github.com/users/cakephp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cakephp/subscriptions","organizations_url":"https://api.github.com/users/cakephp/orgs","repos_url":"https://api.github.com/users/cakephp/repos","events_url":"https://api.github.com/users/cakephp/events{/privacy}","received_events_url":"https://api.github.com/users/cakephp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cakephp/docs","description":"CakePHP CookBook","fork":false,"url":"https://api.github.com/repos/cakephp/docs","forks_url":"https://api.github.com/repos/cakephp/docs/forks","keys_url":"https://api.github.com/repos/cakephp/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cakephp/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cakephp/docs/teams","hooks_url":"https://api.github.com/repos/cakephp/docs/hooks","issue_events_url":"https://api.github.com/repos/cakephp/docs/issues/events{/number}","events_url":"https://api.github.com/repos/cakephp/docs/events","assignees_url":"https://api.github.com/repos/cakephp/docs/assignees{/user}","branches_url":"https://api.github.com/repos/cakephp/docs/branches{/branch}","tags_url":"https://api.github.com/repos/cakephp/docs/tags","blobs_url":"https://api.github.com/repos/cakephp/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cakephp/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cakephp/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cakephp/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cakephp/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/cakephp/docs/languages","stargazers_url":"https://api.github.com/repos/cakephp/docs/stargazers","contributors_url":"https://api.github.com/repos/cakephp/docs/contributors","subscribers_url":"https://api.github.com/repos/cakephp/docs/subscribers","subscription_url":"https://api.github.com/repos/cakephp/docs/subscription","commits_url":"https://api.github.com/repos/cakephp/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cakephp/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cakephp/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cakephp/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cakephp/docs/contents/{+path}","compare_url":"https://api.github.com/repos/cakephp/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cakephp/docs/merges","archive_url":"https://api.github.com/repos/cakephp/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cakephp/docs/downloads","issues_url":"https://api.github.com/repos/cakephp/docs/issues{/number}","pulls_url":"https://api.github.com/repos/cakephp/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/cakephp/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/cakephp/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cakephp/docs/labels{/name}","releases_url":"https://api.github.com/repos/cakephp/docs/releases{/id}","deployments_url":"https://api.github.com/repos/cakephp/docs/deployments","created_at":"2011-03-23T04:54:13Z","updated_at":"2016-07-08T13:05:18Z","pushed_at":"2016-07-15T01:16:26Z","git_url":"git://github.com/cakephp/docs.git","ssh_url":"git@github.com:cakephp/docs.git","clone_url":"https://github.com/cakephp/docs.git","svn_url":"https://github.com/cakephp/docs","homepage":"http://book.cakephp.org","size":54941,"stargazers_count":529,"watchers_count":529,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2102,"mirror_url":null,"open_issues_count":43,"forks":2102,"open_issues":43,"watchers":529,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4175"},"html":{"href":"https://github.com/cakephp/docs/pull/4175"},"issue":{"href":"https://api.github.com/repos/cakephp/docs/issues/4175"},"comments":{"href":"https://api.github.com/repos/cakephp/docs/issues/4175/comments"},"review_comments":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4175/comments"},"review_comment":{"href":"https://api.github.com/repos/cakephp/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cakephp/docs/pulls/4175/commits"},"statuses":{"href":"https://api.github.com/repos/cakephp/docs/statuses/747b59a5221f86ac2962843f197f5d4c4b60812a"}}}}
{"actor":{"display_login":"okinaka"}}