{"id":1227,"date":"2017-12-18T00:04:48","date_gmt":"2017-12-17T20:04:48","guid":{"rendered":"http:\/\/blog.rc21net.ru\/?p=1227"},"modified":"2022-06-10T01:58:24","modified_gmt":"2022-06-09T21:58:24","slug":"yii-model","status":"publish","type":"post","link":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/","title":{"rendered":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model)"},"content":{"rendered":"<p>Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439:<\/p>\n<ul>\n<li><strong>yii\\base\\Model<\/strong> &#8212; \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0411\u0414, \u043c\u043e\u0434\u0435\u043b\u044c \u0444\u043e\u0440\u043c\u044b<\/li>\n<li><strong>yii\\db\\ActiveRecord<\/strong> &#8212; \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0411\u0414<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441 Model<\/h2>\n<h3>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b (Attributes)<\/h3>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044d\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 Model, \u0432\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 attributes(), \u0432 \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u043d\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 ActiveRecords \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044f \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0445 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u00a0\u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u041a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u0430\u043a \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u0430\u043a \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435.<\/p>\n<h3>Attribute Labels<\/h3>\n<p>\u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u043a\u0443 &#8212; \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438. \u041c\u0435\u0442\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 getAttributeLabel(\u201cname\u201d) \u0432\u0435\u0440\u043d\u0435\u0442 \u043c\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 name.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u0438\u043c\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432: \u0438\u043c\u044f \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0431\u0443\u043a\u0432\u0430\u043c. \u041e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 generateAttributeLabel(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 attributeLabels(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442=&gt;\u043c\u0435\u0442\u043a\u0430.<\/p>\n<h3>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)<\/h3>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u043c\u0435\u0442\u043e\u0434 rules():<\/p>\n<pre class=\"lang:php decode:true \">class EntryForm extends Model\n{\n    public $name;\n    public $email;\n\n    public function rules()\n    {\n        return [\n            [['name', 'email'], 'required'],\n            ['email', 'email'],\n        ];\n    }\n}<\/pre>\n<p>\u0412\u044b\u0437\u0432\u0430\u0432 \u0432 action&#8217;\u0435 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 validate() \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438. \u041c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0435\u0442 true,\u00a0\u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u0430, \u0438\u043b\u0438 false, \u0435\u0441\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0430. \u0422\u0430\u043a \u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u0435\u0442\u043e\u0434 validate() \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 hasErrors \u0432 false. \u0421\u0430\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u044b\u0437\u0432\u0430\u0432 getErrors():<\/p>\n<pre class=\"lang:php decode:true \">if ($model-&gt;validate()) {\n    \/\/ \u0412\u0430\u043b\u0438\u0434\u043d\u0430\n} else {\n    \/\/ \u041d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u0430\n    \/\/ \u041e\u0448\u0438\u0431\u043a\u0438: $model-&gt;getErrors()\n}<\/pre>\n<h2>\u041a\u043b\u0430\u0441\u0441 ActiveRecord<\/h2>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043e\u0442 Model.<\/p>\n<p>\u0421 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0432 \u0411\u0414 \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0432\u044f\u0437\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 tableName (static, \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b)<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yii\\base\\Model &#8212; \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0411\u0414, \u043c\u043e\u0434\u0435\u043b\u044c \u0444\u043e\u0440\u043c\u044b yii\\db\\ActiveRecord &#8212; \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0439 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0411\u0414<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[12,13],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.4.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com<\/title>\n<meta name=\"description\" content=\"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yiibaseModel \u0438 yiidbActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com\" \/>\n<meta property=\"og:description\" content=\"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yii\\base\\Model \u0438 yii\\db\\ActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/\" \/>\n<meta property=\"og:site_name\" content=\"devKazakov.com\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-17T20:04:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-09T21:58:24+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"Roman Kazakov\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u043c\u0438\u043d\u0443\u0442\u044b\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/devkazakov.com\/ru\/#website\",\"url\":\"https:\/\/devkazakov.com\/ru\/\",\"name\":\"devKazakov.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/devkazakov.com\/ru\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage\",\"url\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/\",\"name\":\"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com\",\"isPartOf\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#website\"},\"datePublished\":\"2017-12-17T20:04:48+00:00\",\"dateModified\":\"2022-06-09T21:58:24+00:00\",\"description\":\"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yii\\\\base\\\\Model \u0438 yii\\\\db\\\\ActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)\",\"breadcrumb\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/devkazakov.com\/ru\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model)\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage\"},\"author\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"headline\":\"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model)\",\"datePublished\":\"2017-12-17T20:04:48+00:00\",\"dateModified\":\"2022-06-09T21:58:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage\"},\"wordCount\":40,\"publisher\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\"},\"keywords\":[\"PHP\",\"Yii\"],\"inLanguage\":\"ru-RU\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3\",\"name\":\"Roman Kazakov\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/devkazakov.com\/ru\/#personlogo\",\"inLanguage\":\"ru-RU\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g\",\"caption\":\"Roman Kazakov\"},\"logo\":{\"@id\":\"https:\/\/devkazakov.com\/ru\/#personlogo\"},\"sameAs\":[\"https:\/\/devkazakov.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com","description":"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yiibaseModel \u0438 yiidbActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/","og_locale":"ru_RU","og_type":"article","og_title":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com","og_description":"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yii\\base\\Model \u0438 yii\\db\\ActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)","og_url":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/","og_site_name":"devKazakov.com","article_published_time":"2017-12-17T20:04:48+00:00","article_modified_time":"2022-06-09T21:58:24+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"Roman Kazakov","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"2 \u043c\u0438\u043d\u0443\u0442\u044b"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/devkazakov.com\/ru\/#website","url":"https:\/\/devkazakov.com\/ru\/","name":"devKazakov.com","description":"","publisher":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devkazakov.com\/ru\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ru-RU"},{"@type":"WebPage","@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage","url":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/","name":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model) | devKazakov.com","isPartOf":{"@id":"https:\/\/devkazakov.com\/ru\/#website"},"datePublished":"2017-12-17T20:04:48+00:00","dateModified":"2022-06-09T21:58:24+00:00","description":"Yii \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439: yii\\base\\Model \u0438 yii\\db\\ActiveRecord. \u041c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (Attributes) \u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 (Validation Rules)","breadcrumb":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devkazakov.com\/ru\/blog\/yii-model\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devkazakov.com\/ru\/"},{"@type":"ListItem","position":2,"name":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model)"}]},{"@type":"Article","@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#article","isPartOf":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage"},"author":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"headline":"Yii: \u043c\u043e\u0434\u0435\u043b\u044c (model)","datePublished":"2017-12-17T20:04:48+00:00","dateModified":"2022-06-09T21:58:24+00:00","mainEntityOfPage":{"@id":"https:\/\/devkazakov.com\/ru\/blog\/yii-model\/#webpage"},"wordCount":40,"publisher":{"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3"},"keywords":["PHP","Yii"],"inLanguage":"ru-RU"},{"@type":["Person","Organization"],"@id":"https:\/\/devkazakov.com\/ru\/#\/schema\/person\/b3f48bf8438d7d5354ee81e92dc477c3","name":"Roman Kazakov","image":{"@type":"ImageObject","@id":"https:\/\/devkazakov.com\/ru\/#personlogo","inLanguage":"ru-RU","url":"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d99e1eb55cb87629fd1b4c80a24ea831?s=96&d=mm&r=g","caption":"Roman Kazakov"},"logo":{"@id":"https:\/\/devkazakov.com\/ru\/#personlogo"},"sameAs":["https:\/\/devkazakov.com"]}]}},"_links":{"self":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1227"}],"collection":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/comments?post=1227"}],"version-history":[{"count":1,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1227\/revisions"}],"predecessor-version":[{"id":2072,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/posts\/1227\/revisions\/2072"}],"wp:attachment":[{"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/media?parent=1227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/categories?post=1227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devkazakov.com\/ru\/wp-json\/wp\/v2\/tags?post=1227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}