{"id":9928,"date":"2019-06-21T20:17:40","date_gmt":"2019-06-21T11:17:40","guid":{"rendered":"https:\/\/www.itblog.jp\/?p=9928"},"modified":"2019-06-21T20:17:40","modified_gmt":"2019-06-21T11:17:40","slug":"cakephp%e3%81%aeaddbehavior%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.itblog.jp\/?p=9928","title":{"rendered":"CakePHP\u306eaddBehavior\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<p>CakePHP\u306eaddBehavior\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3067\u3059\u3002<\/p>\n\n\n\n<p>CakePHP\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u3066\u3044\u308b\u3068\u3001Table\u30af\u30e9\u30b9\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>class<\/em> ArticlesTable <em>extends<\/em> Table\n{\n    <em>public<\/em> <em>function<\/em> initialize(<em>array<\/em> $config)\n    {\n        $this-&gt;addBehavior('Timestamp');\n    }\n}<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u610f\u5473\u304c\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u8abf\u3079\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u65b0\u3057\u304f Entity \u3092\u4fdd\u5b58\u3059\u308b\u3068\u304d\u3001&nbsp;<code>created<\/code>&nbsp;\u3068&nbsp;<code>modified<\/code>&nbsp;\u306b\u73fe\u5728\u306e\u65e5\u6642\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li><li>Entity \u3092\u66f4\u65b0\u3057\u305f\u3068\u304d\u3001&nbsp;<code>modified<\/code>&nbsp;\u306b\u73fe\u5728\u306e\u65e5\u6642\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li><\/ul>\n\n\n\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u5ba3\u8a00\u3059\u308b\u3053\u3068\u3067\u3001\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u9805\u76ee\u300ccreated\u300d\u3068\u300cmodified\u300d\u304c\u3001\u30c7\u30fc\u30bf\u304c\u4f5c\u6210\u3055\u308c\u305f\u3068\u304d\u306b\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u304c\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u4ed6\u3001\u30c7\u30fc\u30bf\u304c\u66f4\u65b0\u3055\u308c\u305f\u3068\u304d\u306bmodified\u306e\u9805\u76ee\u304c\u81ea\u52d5\u3067\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CakePHP\u306eaddBehavior\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3067\u3059\u3002 CakePHP\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u3066\u3044\u308b\u3068\u3001Table\u30af\u30e9\u30b9\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3059\u3002 class ArticlesTable extends T [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165,131],"tags":[],"class_list":["post-9928","post","type-post","status-publish","format-standard","hentry","category-cakephp","category-131"],"_links":{"self":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts\/9928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9928"}],"version-history":[{"count":0,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts\/9928\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}