{"id":9943,"date":"2020-07-20T12:49:52","date_gmt":"2020-07-20T03:49:52","guid":{"rendered":"https:\/\/www.itblog.jp\/?p=9943"},"modified":"2020-07-20T12:50:21","modified_gmt":"2020-07-20T03:50:21","slug":"cakephp3%e3%80%91validation%e3%81%a8buildrules","status":"publish","type":"post","link":"https:\/\/www.itblog.jp\/?p=9943","title":{"rendered":"[Cakephp3\u3011validation\u3068buildRules\u306e\u9055\u3044\u3084\u4f7f\u3044\u5206\u3051\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<p>Cakephp3\u306eValidation\u3068BuildRules\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n\n\n\n<p>Cakephp3\u3067\u306f\u30d5\u30a9\u30fc\u30e0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\uff09\u306f\u30e2\u30c7\u30eb\u3067\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306e\u65b9\u6cd5\u306b\u3001validation\u3068\u3001BuildRules\u306e\uff12\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305avalidation\u306b\u3064\u3044\u3066\u3067\u3059\u304c\u3001\u57fa\u672c\u7684\u306bmodel\u306evalidationDefault\u30e1\u30bd\u30c3\u30c9\u306e\u5b9a\u7fa9\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u4e00\u822c\u7684\u306a\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306f\u3053\u3061\u3089\u306b\u5b9a\u7fa9\u3057\u3066\u3044\u304f\u30d1\u30bf\u30fc\u30f3\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>BuildRules\u306f\u3001validation\u30e1\u30bd\u30c3\u30c9\u3068\u306f\u5225\u306b\u5b9a\u7fa9\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u901a\u5e38\u306evalidation\u3068\u306f\u8a18\u8ff0\u65b9\u6cd5\u304c\u5fae\u5999\u306b\u9055\u3046\u306e\u3067\u3001\u305d\u3053\u306f\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3067\u3001\u3053\u306e\uff12\u3064\u306e\u4f55\u304c\u9055\u3046\u306e\u304b\u306b\u3064\u3044\u3066\u3067\u3059\u304c\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u901a\u5e38\u306evalidation\u306f\u3001Controller\u5074\u3067newEntity\u3084patchEntity\u3092\u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306b\u5bfe\u3057\u3066\u3001BuildRules\u306f\u3001\u30e2\u30c7\u30eb\u304b\u3089save\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\uff12\u3064\u306e\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\u304b\u3068\u3044\u3046\u3068\u5fae\u5999\u306a\u3068\u3053\u308d\u304c\u3042\u3063\u3066\u79c1\u3082\u5b8c\u5168\u306b\u306f\u7406\u89e3\u3057\u3066\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u4f8b\u3048\u3070\u65e5\u4ed8\u3092\u6bd4\u8f03\u3059\u308b\u3088\u3046\u306a\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u5834\u5408\u3001Build Rules\u306e\u307b\u3046\u306b\u8ffd\u52a0\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u305c\u306a\u3089\u3001\u65e5\u4ed8\u3092\u6bd4\u8f03\u3059\u308b\u3088\u3046\u306a\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306e\u5834\u5408\u3001\u305d\u3082\u305d\u3082\u5165\u529b\u5024\u304c\u65e5\u4ed8\u3067\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u5834\u5408\u3001\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306e\u51e6\u7406\u306e\u9014\u4e2d\u3067\u65e5\u4ed8\u3067\u306a\u3044\u306e\u3067\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u308a\u3057\u3066\u3001\u30c7\u30fc\u30bf\u304c\u300c\u65e5\u4ed8\u3067\u3042\u308b\u300d\u3068\u3044\u3046\u524d\u63d0\u3092\u62c5\u4fdd\u3059\u308b\u3053\u3068\u304c\u96e3\u3057\u3044\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092\u3001Validation\u306e\u307b\u3046\u306b\u65e5\u4ed8\u306e\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u3092\u5b9a\u7fa9\u3057\u3066\u304a\u3044\u3066\u3001\u65e5\u4ed8\u30c7\u30fc\u30bf\u306e\u6bd4\u8f03\u306fBuiled Rules\u306e\u307b\u3046\u306b\u5b9a\u7fa9\u3057\u3066\u304a\u3051\u3070\u3001\u65e5\u4ed8\u3067\u306a\u3044\u5834\u5408\u306fpatchEntity\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066save\u6642\u306eBuild Rules\u307e\u3067\u51e6\u7406\u304c\u9032\u307e\u306a\u3044\u306e\u3067\u3001\u5185\u90e8\u7684\u306a\u51e6\u7406\u3067\u65e5\u4ed8\u304c\u3069\u3046\u3053\u3046\u307f\u305f\u3044\u306a\u51e6\u7406\u3092\u66f8\u304f\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ed6\u306b\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u79c1\u306e\u7406\u89e3\u3067\u306f\u305d\u3093\u306a\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cakephp3\u306eValidation\u3068BuildRules\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3067\u3059\u3002 Cakephp3\u3067\u306f\u30d5\u30a9\u30fc\u30e0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\uff09\u306f\u30e2\u30c7\u30eb\u3067\u884c\u308f\u308c\u307e\u3059\u304c\u3001\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306e\u65b9\u6cd5\u306b\u3001validation\u3068\u3001Bu [&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-9943","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\/9943","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=9943"}],"version-history":[{"count":0,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=\/wp\/v2\/posts\/9943\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itblog.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}