{"id":2100,"date":"2020-05-12T03:48:02","date_gmt":"2020-05-12T03:48:02","guid":{"rendered":"https:\/\/www.magetop.com\/blog\/?p=2100"},"modified":"2020-05-15T10:35:59","modified_gmt":"2020-05-15T10:35:59","slug":"model-trong-magento-2","status":"publish","type":"post","link":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2"},"content":{"rendered":"\n<p>Ti\u1ebfp t\u1ee5c series h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">B\u01b0\u1edbc 1: Th\u00eam d\u1eef li\u1ec7u v\u00e0o database<\/h2>\n\n\n\n<p>\u0110\u1ec3 c\u00f3 th\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database ch\u00fang ta c\u1ea7n th\u00eam d\u1eef li\u1ec7u v\u00e0o database, trong \u0111\u01b0\u1eddng d\u1eabn <strong>app\\code\\Magetop\\Helloworld\\Setup<\/strong>\\ t\u1ea1o file <strong>InstallData.php<\/strong> v\u1edbi \u0111o\u1ea1n code sau:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Setup;\n\nuse Magento\\Framework\\Setup\\InstallDataInterface;\nuse Magento\\Framework\\Setup\\ModuleContextInterface;\nuse Magento\\Framework\\Setup\\ModuleDataSetupInterface;\n\n\nclass InstallData implements InstallDataInterface\n{\n    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\n    {\n        $setup-&gt;startSetup();\n        $tableName = $setup-&gt;getTable('magetop_hello');\n        if($setup-&gt;getConnection()-&gt;isTableExists($tableName) == true){\n            $data = &#x5B;\n                &#x5B;\n                    'title' =&gt; 'Blog 1',\n                    'summary' =&gt; 'summary blog 1',\n                    'description' =&gt; 'description blog 1',\n                    'status' =&gt; 1,\n                    'create_at' =&gt; date('Y-m-d H:i:s'),\n                ],\n                &#x5B;\n                    'title' =&gt; 'Blog 2',\n                    'summary' =&gt; 'summary blog 2',\n                    'description' =&gt; 'description blog 2',\n                    'status' =&gt; 1,\n                    'create_at' =&gt; date('Y-m-d H:i:s'),\n                ],\n                &#x5B;\n                    'title' =&gt; 'Blog 3',\n                    'summary' =&gt; 'summary blog 3',\n                    'description' =&gt; 'description blog 3',\n                    'status' =&gt; 1,\n                    'create_at' =&gt; date('Y-m-d H:i:s'),\n                ],\n            ];\n            foreach ($data as $item){\n                $setup-&gt;getConnection()-&gt;insert($tableName, $item);\n            }\n        }\n        $setup-&gt;endSetup();\n    }\n}\n<\/pre><\/div>\n\n\n<p>C\u00e1c b\u1ea1n c\u00f3 th\u1ec3 t\u00f9y ch\u1ec9nh d\u1eef li\u1ec7u t\u00f9y theo \u00fd c\u1ee7a m\u00ecnh.<\/p>\n\n\n\n<p>T\u1ea1o xong c\u00e1c b\u1ea1n t\u0103ng <strong>setup_version<\/strong> trong file <strong>module.xml<\/strong> l\u00ean r\u1ed3i ch\u1ea1y l\u1ec7nh <code>php bin\/magento setup:upgrade<\/code>.<\/p>\n\n\n\n<p>B\u00e2y gi\u1edd ch\u00fang ta v\u00e0o b\u1ea3ng <strong>magetop_hello<\/strong> ki\u1ec3m tra.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"505\" data-attachment-id=\"2104\" data-permalink=\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/du-lieu-database-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?fit=998%2C630&amp;ssl=1\" data-orig-size=\"998,630\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"du-lieu-database-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?fit=300%2C189&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?fit=800%2C505&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?resize=800%2C505&#038;ssl=1\" alt=\"d\u1eef li\u1ec7u b\u1ea3ng magetop_hello\" class=\"wp-image-2104\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?w=998&amp;ssl=1 998w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?resize=300%2C189&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/du-lieu-database-1.jpg?resize=768%2C485&amp;ssl=1 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Tr\u01b0\u1eddng h\u1ee3p n\u1ebfu t\u0103ng version module l\u00ean r\u1ed3i m\u00e0 v\u1eabn kh\u00f4ng th\u1ea5y data th\u00ec b\u1ea1n h\u00e3y th\u1eed g\u1ee1 module \u0111i c\u00e0i l\u1ea1i.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">B\u01b0\u1edbc 2: T\u1ea1o Model<\/h2>\n\n\n\n<p>C\u00e1c b\u1ea1n t\u1ea1o th\u01b0 m\u1ee5c Model theo \u0111\u01b0\u1eddng d\u1eabn <strong>app\\code\\Magetop\\Helloworld\\Model<\/strong>. T\u1ea1o file <strong>Posts.php<\/strong> trong th\u01b0 m\u1ee5c <strong>Model<\/strong> v\u1edbi \u0111o\u1ea1n code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Model;\n\nuse Magento\\Framework\\Model\\AbstractModel;\n\nclass Posts extends AbstractModel{\n    protected function _construct()\n    {\n        $this-&gt;_init('Magetop\\Helloworld\\Model\\ResourceModel\\Posts');\n    }\n}\n<\/pre><\/div>\n\n\n<p>Ti\u1ebfp theo t\u1ea1o file <strong>Posts.php<\/strong> theo \u0111\u01b0\u1eddng d\u1eabn <strong>app\\code\\Magetop\\Helloworld\\Model\\ResourceModel<\/strong>\\ k\u00e8m \u0111o\u1ea1n code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Model\\ResourceModel;\n\nuse Magento\\Framework\\Model\\ResourceModel\\Db\\AbstractDb;\n\nclass Posts extends AbstractDb\n{\n    protected function _construct()\n    {\n        \/\/ magetop_hello l\u00e0 t\u00ean b\u1ea3ng , id l\u00e0 kh\u00f3a ch\u00ednh primary c\u1ee7a b\u1ea3ng\n        $this-&gt;_init('magetop_hello', 'id');\n    }\n}\n<\/pre><\/div>\n\n\n<p>Theo \u0111\u01b0\u1eddng d\u1eabn <strong>app\\code\\Magetop\\Helloworld\\Model\\ResourceModel\\Posts<\/strong>\\ t\u1ea1o file <strong>Collection.php<\/strong> v\u1edbi \u0111o\u1ea1n code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Model\\ResourceModel\\Posts;\n\nuse Magento\\Framework\\Model\\ResourceModel\\Db\\Collection\\AbstractCollection;\n\nclass Collection extends AbstractCollection\n{\n    protected function _construct()\n    {\n        $this-&gt;_init(\n            'Magetop\\Helloworld\\Model\\Posts',\n            'Magetop\\Helloworld\\Model\\ResourceModel\\Posts'\n        );\n    }\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">B\u01b0\u1edbc 3: L\u1ea5y d\u1eef li\u1ec7u t\u1eeb database<\/h2>\n\n\n\n<p>T\u1ea1o file <strong>Data.php<\/strong> theo \u0111\u01b0\u1eddng \u0111\u1eabn <strong>app\\code\\Magetop\\Helloworld\\Controller\\Get<\/strong>\\ v\u1edbi \u0111o\u1ea1n code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Controller\\Get;\n\nuse Magento\\Framework\\App\\Action\\Action;\nuse Magento\\Framework\\View\\Result\\PageFactory;\nuse Magento\\Framework\\App\\Action\\Context;\nuse Magetop\\Helloworld\\Model\\ResourceModel\\Posts\\CollectionFactory;\n\nclass Data extends Action\n{\n    protected $PageFactory;\n    protected $PostsFactory;\n\n    public function __construct(Context $context, PageFactory $pageFactory, CollectionFactory $postsFactory)\n    {\n        parent::__construct($context);\n        $this-&gt;PageFactory = $pageFactory;\n        $this-&gt;PostsFactory = $postsFactory;\n    }\n\n    public function execute()\n    {\n        echo &quot;L\u1ea5y d\u1eef li\u1ec7u t\u1eeb b\u1ea3ng magetop_hello&quot;;\n        $this-&gt;PostsFactory-&gt;create();\n        $collection = $this-&gt;PostsFactory-&gt;create()\n            -&gt;addFieldToSelect(array('title','summary','description','status','create_at'))\n            -&gt;addFieldToFilter('status',1)\n            -&gt;setPageSize(10);\n        echo '&lt;pre&gt;';\n        print_r($collection-&gt;getData());\n        echo '&lt;pre&gt;';\n    }\n}\n<\/pre><\/div>\n\n\n<p>Xong c\u00e1c b\u1ea1n ch\u1ea1y l\u1ec7nh: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>php bin\/magento setup:upgrade<\/code><\/li><li><code>php bin\/magento setup:static-content:deploy -f<\/code><\/li><li><code>php bin\/magento cache:clean<\/code><\/li><\/ul>\n\n\n\n<p>Gi\u1edd truy c\u1eadp v\u00e0o \u0111\u1ecba ch\u1ec9 <code>&lt;domain-cua-ban&gt;\/hello\/get\/data<\/code> \u0111\u1ec3 ki\u1ec3m tra.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"700\" data-attachment-id=\"2107\" data-permalink=\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/show-du-lieu-database\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?fit=884%2C773&amp;ssl=1\" data-orig-size=\"884,773\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"show-d\u1eef-li\u1ec7u-database\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?fit=300%2C262&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?fit=800%2C700&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?resize=800%2C700&#038;ssl=1\" alt=\"show d\u1eef li\u1ec7u b\u1ea3ng magetop_hello\" class=\"wp-image-2107\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?w=884&amp;ssl=1 884w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?resize=300%2C262&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/show-d%E1%BB%AF-li%E1%BB%87u-database.jpg?resize=768%2C672&amp;ssl=1 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>D\u1eef li\u1ec7u \u0111\u00fang v\u1edbi trong b\u1ea3ng.<\/p>\n\n\n\n<p>V\u1eady l\u00e0 m\u00ecnh \u0111\u00e3 h\u01b0\u1edbng d\u1eabn xong c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2.<\/p>\n\n\n\n<p>\u0110\u1ec3 d\u1ec5 hi\u1ec3u h\u01a1n c\u00e1c b\u1ea1n n\u00ean \u0111\u1ecdc c\u00e1c b\u00e0i vi\u1ebft h\u01b0\u1edbng d\u1eabn tr\u01b0\u1edbc c\u1ee7a m\u00ecnh: <a rel=\"noreferrer noopener\" href=\"https:\/\/www.magetop.com\/blog\/tao-table-database-trong-magento-2\/\" target=\"_blank\">H\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2 (ph\u1ea7n 2)<\/a>.<\/p>\n\n\n\n<p>\u1ede b\u00e0i h\u01b0\u1edbng d\u1eabn ti\u1ebfp theo m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n <a rel=\"noreferrer noopener\" href=\"https:\/\/www.magetop.com\/blog\/tao-view-trong-magento-2\/\" target=\"_blank\">c\u00e1ch t\u1ea1o view trong Magento 2<\/a>.<\/p>\n\n\n\n<p>C\u1ea3m \u01a1n c\u00e1c b\u1ea1n \u0111\u00e3 \u0111\u1ecdc b\u00e0i vi\u1ebft.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ti\u1ebfp t\u1ee5c series h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.<\/p>\n","protected":false},"author":108,"featured_media":2110,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[226],"tags":[431,434,435,432,433],"class_list":["post-2100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vn","tag-huong-dan-dung-model-trong-magento-2","tag-huong-dan-lap-trinh-magento-2","tag-huong-dan-lap-trinh-module-phan-3","tag-huong-dan-su-dung-model-trong-magento-2","tag-model-trong-magento-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog<\/title>\n<meta name=\"description\" content=\"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog\" \/>\n<meta property=\"og:description\" content=\"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Magetop Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-12T03:48:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-15T10:35:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h\u01b0\u1edbng-d\u1eabn-s\u1eed-d\u1ee5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"405\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Callula Huy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:site\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Callula Huy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\"},\"author\":{\"name\":\"Callula Huy\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/a2bf0aa38cec01bc41197b9ec4b3e8c9\"},\"headline\":\"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2\",\"datePublished\":\"2020-05-12T03:48:02+00:00\",\"dateModified\":\"2020-05-15T10:35:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\"},\"wordCount\":440,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1\",\"keywords\":[\"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2\",\"h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh Magento 2\",\"h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module ph\u1ea7n 3\",\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Model trong Magento 2\",\"Model trong Magento 2\"],\"articleSection\":[\"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\",\"url\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\",\"name\":\"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1\",\"datePublished\":\"2020-05-12T03:48:02+00:00\",\"dateModified\":\"2020-05-15T10:35:59+00:00\",\"description\":\"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1\",\"width\":750,\"height\":405,\"caption\":\"h\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng model trong Magento 2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.magetop.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"name\":\"Magetop Blog\",\"description\":\"Exploring Magento Tips, Tricks, and Trends\",\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.magetop.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\",\"name\":\"Magetop.com\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"width\":475,\"height\":475,\"caption\":\"Magetop.com\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/x.com\/MagetopStore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/a2bf0aa38cec01bc41197b9ec4b3e8c9\",\"name\":\"Callula Huy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/321e837578b99a75c9d7f5c884e62e11b3b6df2b5934726e98fd365f580393c7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/321e837578b99a75c9d7f5c884e62e11b3b6df2b5934726e98fd365f580393c7?s=96&d=mm&r=g\",\"caption\":\"Callula Huy\"},\"description\":\"Callula is the Marketing Executive at Magetop. With more than 5 years of copywriting under his belt, Callula is into creating valuable content that is straight to the point. Life student. Workaholic. Foreign languages and traveling aficionado.\",\"sameAs\":[\"http:\/\/magetop.com\"],\"url\":\"https:\/\/www.magetop.com\/blog\/author\/callula-huy\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog","description":"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.","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:\/\/www.magetop.com\/blog\/model-trong-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog","og_description":"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.","og_url":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/","og_site_name":"Magetop Blog","article_publisher":"https:\/\/www.facebook.com\/MagetopStore","article_published_time":"2020-05-12T03:48:02+00:00","article_modified_time":"2020-05-15T10:35:59+00:00","og_image":[{"width":750,"height":405,"url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h\u01b0\u1edbng-d\u1eabn-s\u1eed-d\u1ee5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","type":"image\/png"}],"author":"Callula Huy","twitter_card":"summary_large_image","twitter_creator":"@MagetopStore","twitter_site":"@MagetopStore","twitter_misc":{"Written by":"Callula Huy","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#article","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/"},"author":{"name":"Callula Huy","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/a2bf0aa38cec01bc41197b9ec4b3e8c9"},"headline":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2","datePublished":"2020-05-12T03:48:02+00:00","dateModified":"2020-05-15T10:35:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/"},"wordCount":440,"commentCount":0,"publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","keywords":["H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2","h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh Magento 2","h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module ph\u1ea7n 3","H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Model trong Magento 2","Model trong Magento 2"],"articleSection":["Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/","url":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/","name":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2 - Magetop Blog","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","datePublished":"2020-05-12T03:48:02+00:00","dateModified":"2020-05-15T10:35:59+00:00","description":"Ti\u1ebfp t\u1ee5c lo\u1ea1t h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module, trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch s\u1eed d\u1ee5ng Model trong Magento 2 \u0111\u1ec3 truy xu\u1ea5t d\u1eef li\u1ec7u t\u1eeb database.","breadcrumb":{"@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#primaryimage","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","width":750,"height":405,"caption":"h\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng model trong Magento 2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.magetop.com\/blog\/model-trong-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.magetop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"H\u01b0\u1edbng d\u1eabn d\u00f9ng Model trong Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/www.magetop.com\/blog\/#website","url":"https:\/\/www.magetop.com\/blog\/","name":"Magetop Blog","description":"Exploring Magento Tips, Tricks, and Trends","publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.magetop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.magetop.com\/blog\/#organization","name":"Magetop.com","url":"https:\/\/www.magetop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","width":475,"height":475,"caption":"Magetop.com"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MagetopStore","https:\/\/x.com\/MagetopStore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA"]},{"@type":"Person","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/a2bf0aa38cec01bc41197b9ec4b3e8c9","name":"Callula Huy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/321e837578b99a75c9d7f5c884e62e11b3b6df2b5934726e98fd365f580393c7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/321e837578b99a75c9d7f5c884e62e11b3b6df2b5934726e98fd365f580393c7?s=96&d=mm&r=g","caption":"Callula Huy"},"description":"Callula is the Marketing Executive at Magetop. With more than 5 years of copywriting under his belt, Callula is into creating valuable content that is straight to the point. Life student. Workaholic. Foreign languages and traveling aficionado.","sameAs":["http:\/\/magetop.com"],"url":"https:\/\/www.magetop.com\/blog\/author\/callula-huy\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/h%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-s%E1%BB%AD-d%E1%BB%A5ng-model-trong-Magento-2.png?fit=750%2C405&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/paOdw5-xS","jetpack-related-posts":[{"id":2197,"url":"https:\/\/www.magetop.com\/blog\/tao-view-trong-magento-2\/","url_meta":{"origin":2100,"position":0},"title":"H\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2: T\u1ea1o view","author":"Callula Huy","date":"May 15, 2020","format":false,"excerpt":"Trong b\u00e0i 4 c\u1ee7a lo\u1ea1t b\u00e0i h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2, ch\u00fang ta s\u1ebd c\u00f9ng nhau xem c\u00e1ch ho\u1ea1t \u0111\u1ed9ng c\u1ee7a view.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2 t\u1ea1o view","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/tao-view-magento-2.png?fit=750%2C405&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/tao-view-magento-2.png?fit=750%2C405&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/tao-view-magento-2.png?fit=750%2C405&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/tao-view-magento-2.png?fit=750%2C405&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2376,"url":"https:\/\/www.magetop.com\/blog\/tao-system-xml-va-helper\/","url_meta":{"origin":2100,"position":1},"title":"H\u01b0\u1edbng d\u1eabn t\u1ea1o system.xml v\u00e0 s\u1eed d\u1ee5ng Helper trong Magento 2","author":"Callula Huy","date":"June 12, 2020","format":false,"excerpt":"\u1ede b\u00e0i vi\u1ebft tr\u01b0\u1edbc m\u00ecnh \u0111\u00e3 h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch t\u1ea1o ra menu cho module, h\u00f4m nay m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch t\u1ea1o system.xml v\u00e0 s\u1eed d\u1ee5ng Helper trong Magento 2.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn t\u1ea1o system.xml v\u00e0 s\u1eed d\u1ee5ng Helper","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/06\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-system.xml-v%C3%A0-s%E1%BB%AD-d%E1%BB%A5ng-Helper.png?fit=750%2C405&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/06\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-system.xml-v%C3%A0-s%E1%BB%AD-d%E1%BB%A5ng-Helper.png?fit=750%2C405&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/06\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-system.xml-v%C3%A0-s%E1%BB%AD-d%E1%BB%A5ng-Helper.png?fit=750%2C405&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/06\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-system.xml-v%C3%A0-s%E1%BB%AD-d%E1%BB%A5ng-Helper.png?fit=750%2C405&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1545,"url":"https:\/\/www.magetop.com\/blog\/tao-table-database-trong-magento-2\/","url_meta":{"origin":2100,"position":2},"title":"H\u01b0\u1edbng d\u1eabn t\u1ea1o table database trong Magento 2","author":"Callula Huy","date":"March 20, 2020","format":false,"excerpt":"Ti\u1ebfp n\u1ed1i lo\u1ea1t b\u00e0i h\u01b0\u1edbng d\u1eabn code module Magento 2, Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch t\u1ea1o b\u1ea3ng(table) database trong Magento 2.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"B\u00e0i 2: h\u01b0\u1edbng d\u1eabn t\u1ea1o table database Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/taotabledatabase.png?fit=750%2C405&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/taotabledatabase.png?fit=750%2C405&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/taotabledatabase.png?fit=750%2C405&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/taotabledatabase.png?fit=750%2C405&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":5730,"url":"https:\/\/www.magetop.com\/blog\/fix-loi-unique-constraint-violation-found-magento-2\/","url_meta":{"origin":2100,"position":3},"title":"H\u01b0\u1edbng d\u1eabn fix l\u1ed7i Unique Constraint Violation Found trong Magento 2","author":"Callula Huy","date":"June 3, 2021","format":false,"excerpt":"Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n c\u00e1ch fix l\u1ed7i\u00a0Unique Constraint Violation Found\u00a0trong Magento 2.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn fix l\u1ed7i Unique Constraint Violation Found trong Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/06\/Huong-dan-fix-loi-Unique-Constraint-Violation-Found-trong-Magento-2.png?fit=626%2C402&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/06\/Huong-dan-fix-loi-Unique-Constraint-Violation-Found-trong-Magento-2.png?fit=626%2C402&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/06\/Huong-dan-fix-loi-Unique-Constraint-Violation-Found-trong-Magento-2.png?fit=626%2C402&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2256,"url":"https:\/\/www.magetop.com\/blog\/tao-menu-admin-module-magento-2\/","url_meta":{"origin":2100,"position":4},"title":"H\u01b0\u1edbng d\u1eabn t\u1ea1o menu admin module trong Magento 2","author":"Callula Huy","date":"May 22, 2020","format":false,"excerpt":"Ti\u1ebfp t\u1ee5c v\u1edbi lo\u1ea1t b\u00e0i h\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2, \u1edf b\u00e0i h\u01b0\u1edbng d\u1eabn ph\u1ea7n 5 m\u00ecnh s\u1ebd gi\u1edbi thi\u1ec7u v\u1edbi c\u00e1c b\u1ea1n c\u00e1ch t\u1ea1o menu admin cho module.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn t\u1ea1o menu admin module trong Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-menu-admin-module-trong-Magento-2.png?fit=750%2C405&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-menu-admin-module-trong-Magento-2.png?fit=750%2C405&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-menu-admin-module-trong-Magento-2.png?fit=750%2C405&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/05\/H%C6%B0%E1%BB%9Bng-d%E1%BA%ABn-t%E1%BA%A1o-menu-admin-module-trong-Magento-2.png?fit=750%2C405&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1478,"url":"https:\/\/www.magetop.com\/blog\/tao-module-don-gian-magento-2\/","url_meta":{"origin":2100,"position":5},"title":"H\u01b0\u1edbng d\u1eabn t\u1ea1o module \u0111\u01a1n gi\u1ea3n trong Magento 2","author":"Callula Huy","date":"March 7, 2020","format":false,"excerpt":"Trong b\u00e0i vi\u1ebft n\u00e0y m\u00ecnh s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1c b\u1ea1n c\u00e1ch t\u1ea1o 1 module Magento 2 \u0111\u01a1n gi\u1ea3n - Hello world module.","rel":"","context":"In &quot;Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t&quot;","block_context":{"text":"Magento 2 H\u01b0\u1edbng D\u1eabn Ti\u1ebfng Vi\u1ec7t","link":"https:\/\/www.magetop.com\/blog\/vn\/"},"img":{"alt_text":"H\u01b0\u1edbng d\u1eabn l\u1eadp tr\u00ecnh module Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/2459444_7fd3-750x405-1.png?fit=750%2C405&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/2459444_7fd3-750x405-1.png?fit=750%2C405&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/2459444_7fd3-750x405-1.png?fit=750%2C405&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/03\/2459444_7fd3-750x405-1.png?fit=750%2C405&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/2100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/users\/108"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/comments?post=2100"}],"version-history":[{"count":7,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/2100\/revisions"}],"predecessor-version":[{"id":2203,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/2100\/revisions\/2203"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media\/2110"}],"wp:attachment":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media?parent=2100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/categories?post=2100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/tags?post=2100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}