{"id":315,"date":"2022-03-25T17:21:39","date_gmt":"2022-03-25T10:21:39","guid":{"rendered":"https:\/\/magerubik.com\/blog\/?p=315"},"modified":"2023-04-24T09:19:22","modified_gmt":"2023-04-24T02:19:22","slug":"magento-2-create-model-collection","status":"publish","type":"post","link":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/","title":{"rendered":"Magento 2 create model collection"},"content":{"rendered":"\n<div class=\"magerubik-quote\">\n\t<p>Model is an important part of MVC architecture. In Magento 2 Models will be responsible for working with the database with have many different functions such as managing data, installing or upgrading module. In the following article, we will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.<\/p>\n<\/div>\n<p>Assume that you have read through and practiced the articles <a href=\"http:\/\/magerubik.com\/blog\/create-magento-2-extension-step-by-step\" title=\"Create Magento 2 extension\">create Magento 2 extension<\/a> and <a href=\"http:\/\/magerubik.com\/blog\/create-magento-2-database-table\" title=\"Create Magento 2 database table\">Create Magento 2 database table<\/a> or are knowledgeable about it.<\/p>\n<p>Continuous our example we will create Models to manage data in table <span class=\"code\">vendor_message<\/span><\/p>\n<h2 class=\"h3\"><strong>1. Create Model<\/strong><\/h2>\n<p>Create file <span class=\"code\">app\\code\\Magerubik\\Simple\\Model\\Message.php<\/span> with below content.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nnamespace Magerubik\\Simple\\Model;\nclass Message extends \\Magento\\Framework\\Model\\AbstractModel\n{\n    protected function _construct()\n    {\n        $this->_init('Magerubik\\Simple\\Model\\ResourceModel\\Message');\n    }\n}<\/pre>\n\n\n\n<p>The Model will extends class <span class=\"code\">AbstractModel<\/span> from Magento Framework.<\/p>\n<p>Every model has to use the _construct() method to call _init() method to pass a Resource Model as an argument to get information from the database. In our example is <span class=\"code\">Magerubik\\Simple\\Model\\ResourceModel\\Message<\/span><\/p>\n<h2 class=\"h3\"><strong>2. Create Resource Model<\/strong><\/h2>\n<p>Create file <span class=\"code\">app\\code\\Magerubik\\Simple\\Model\\ResourceModel\\Message.php<\/span> with below content.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nnamespace Magerubik\\Simple\\Model\\ResourceModel;\nclass Message extends \\Magento\\Framework\\Model\\ResourceModel\\Db\\AbstractDb\n{\n    protected function _construct()\n    {\n        $this->_init('vendor_message', 'messages_id');\n    }\n}<\/pre>\n\n\n\n<p>The Resource Model will extend <span class=\"code\">AbstractDb<\/span> from Magento Framework which contains the functions for fetching information from the database. The _init() method of Resource Model will pass table name and the primary key for that table.<\/p>\n<h2 class=\"h3\"><strong>3. Create Resource Model Collection<\/strong><\/h2>\n<p>Create file <span class=\"code\">app\\code\\Magerubik\\Simple\\Model\\ResourceModel\\Message\\Collection.php<\/span> with below content.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nnamespace Magerubik\\Simple\\Model\\ResourceModel\\Message;\nclass Collection extends \\Magento\\Framework\\Model\\ResourceModel\\Db\\Collection\\AbstractCollection\n{\n    protected $_idFieldName = 'messages_id';\n    protected function _construct()\n    {\n        $this->_init('Magerubik\\Simple\\Model\\Message', 'Magerubik\\Simple\\Model\\ResourceModel\\Message');\n    }\n}<\/pre>\n\n\n\n<p>The Resource Model Collection will extend <span class=\"code\">AbstractCollection<\/span> from Magento Framework. The _init() method of Resource Model Collection will pass the model and resource model.<\/p>\n<h2 class=\"h3\"><strong>4. How use Models get Collection<\/strong><\/h2>\n<p>In Magento, the Factory will be used to instantiate an object. The Factory class name is the name of the Model class and is append with the &#8216;Factory&#8217; word. Magento will automatically generate it for you and is placed in the generated folder.<\/p>\n<p>For our example It is <span class=\"code\">var\/generation\/Magerubik\/Simple\/Model\/MessageFactory.php<\/span><\/p>\n<p>Now we will create a controller to show data. Create file <span class=\"code\">app\\code\\Magerubik\\Simple\\Controller\\Message\\Index.php<\/span> with below content.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nnamespace Magerubik\\Simple\\Controller\\Message;\nclass Index extends \\Magento\\Framework\\App\\Action\\Action\n{\n    protected $postFactory;\n    public function __construct(\n        \\Magento\\Framework\\App\\Action\\Context $context,\n        \\Magerubik\\Simple\\Model\\MessageFactory $messageFactory\n    )\n    {\n        $this->_messageFactory = $messageFactory;\n        return parent::__construct($context);\n    }\n    public function execute()\n    {\n        $data = $this->_messageFactory->create()->getCollection();\n        foreach ($data as $value) {\n            echo \"&lt;pre>\";\n            print_r($value->getData());\n            echo \"&lt;\/pre>\";\n        }\n    }\n}<\/pre>\n\n\n\n<p>If you can see the below screenshot everything is ok.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/cdn2.magerubik.com\/media\/module\/magento-model-collection.jpg\" alt=\"\"><\/figure>\t\n<blockquote class=\"wp-block-quote\">\n\t<p>Now you know how Magento 2 create model collection. In the next posts we will learn how to use <a href=\"https:\/\/magerubik.com\/blog\/magento-2-use-ui-component\" title=\"Magento 2 UI component\">Magento 2 UI component<\/a>. <a href=\"https:\/\/magerubik.com\/contact\" title=\"Contact Magerubik\">Contact us<\/a> if you face any problems during the installation process.<\/p>\n<\/blockquote>\n<p class=\"simple-note\">You can download the demo code for this entire series from <a href=\"https:\/\/github.com\/magerubik\/module-simple\" title=\"demo code on github\" rel=\"nofollow noopener\">GitHub<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Model is an important part of MVC architecture. In Magento 2 Models will be responsible for working with the database<\/p>\n","protected":false},"author":1,"featured_media":318,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-2-extension-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 create model collection | MageRubik<\/title>\n<meta name=\"description\" content=\"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 create model collection | MageRubik\" \/>\n<meta property=\"og:description\" content=\"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\" \/>\n<meta property=\"og:site_name\" content=\"MageRubik\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/magerubik\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/magerubik\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-25T10:21:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-24T02:19:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hilary howard\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/magerubik\" \/>\n<meta name=\"twitter:site\" content=\"@magerubik\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hilary howard\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\"},\"author\":{\"name\":\"Hilary howard\",\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8\"},\"headline\":\"Magento 2 create model collection\",\"datePublished\":\"2022-03-25T10:21:39+00:00\",\"dateModified\":\"2023-04-24T02:19:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\"},\"wordCount\":380,\"publisher\":{\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8\"},\"image\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg\",\"articleSection\":[\"Magento 2 Extension Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\",\"url\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\",\"name\":\"Magento 2 create model collection | MageRubik\",\"isPartOf\":{\"@id\":\"https:\/\/magerubik.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg\",\"datePublished\":\"2022-03-25T10:21:39+00:00\",\"dateModified\":\"2023-04-24T02:19:22+00:00\",\"description\":\"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.\",\"breadcrumb\":{\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage\",\"url\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg\",\"contentUrl\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg\",\"width\":800,\"height\":445,\"caption\":\"Magento 2 how to create model collection\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Magerubik blog site\",\"item\":\"https:\/\/magerubik.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 2 create model collection\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/magerubik.com\/blog\/#website\",\"url\":\"https:\/\/magerubik.com\/blog\/\",\"name\":\"Magerubik\",\"description\":\"MageRubik blog site\",\"publisher\":{\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8\"},\"alternateName\":\"Magento 2 Extension\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/magerubik.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8\",\"name\":\"Hilary howard\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magerubik-logo.png\",\"contentUrl\":\"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magerubik-logo.png\",\"width\":265,\"height\":90,\"caption\":\"Hilary howard\"},\"logo\":{\"@id\":\"https:\/\/magerubik.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/localhost\/blog\",\"https:\/\/www.facebook.com\/magerubik\",\"https:\/\/www.instagram.com\/magerubik\",\"https:\/\/www.linkedin.com\/magerubik\",\"https:\/\/www.pinterest.com\/magerubik\",\"https:\/\/twitter.com\/https:\/\/www.twitter.com\/magerubik\",\"https:\/\/www.myspace.com\/magerubik\",\"https:\/\/www.youtube.com\/magerubik\",\"https:\/\/www.soundcloud.com\/magerubik\",\"https:\/\/www.tumblr.com\/magerubik\",\"https:\/\/www.wikipedia.com\/magerubik\"],\"url\":\"https:\/\/magerubik.com\/blog\/author\/hilary-howard\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2 create model collection | MageRubik","description":"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.","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:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/","og_locale":"en_US","og_type":"article","og_title":"Magento 2 create model collection | MageRubik","og_description":"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.","og_url":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/","og_site_name":"MageRubik","article_publisher":"https:\/\/www.facebook.com\/magerubik","article_author":"https:\/\/www.facebook.com\/magerubik","article_published_time":"2022-03-25T10:21:39+00:00","article_modified_time":"2023-04-24T02:19:22+00:00","og_image":[{"width":800,"height":445,"url":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg","type":"image\/jpeg"}],"author":"Hilary howard","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/magerubik","twitter_site":"@magerubik","twitter_misc":{"Written by":"Hilary howard","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#article","isPartOf":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/"},"author":{"name":"Hilary howard","@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8"},"headline":"Magento 2 create model collection","datePublished":"2022-03-25T10:21:39+00:00","dateModified":"2023-04-24T02:19:22+00:00","mainEntityOfPage":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/"},"wordCount":380,"publisher":{"@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8"},"image":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage"},"thumbnailUrl":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg","articleSection":["Magento 2 Extension Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/","url":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/","name":"Magento 2 create model collection | MageRubik","isPartOf":{"@id":"https:\/\/magerubik.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage"},"image":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage"},"thumbnailUrl":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg","datePublished":"2022-03-25T10:21:39+00:00","dateModified":"2023-04-24T02:19:22+00:00","description":"We will learn how Magento 2 create model collection with Model, Resource Model, Resource Model Collection.","breadcrumb":{"@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#primaryimage","url":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg","contentUrl":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magento-how-to-create-model-collection.jpg","width":800,"height":445,"caption":"Magento 2 how to create model collection"},{"@type":"BreadcrumbList","@id":"https:\/\/magerubik.com\/blog\/magento-2-create-model-collection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magerubik blog site","item":"https:\/\/magerubik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Magento 2 create model collection"}]},{"@type":"WebSite","@id":"https:\/\/magerubik.com\/blog\/#website","url":"https:\/\/magerubik.com\/blog\/","name":"Magerubik","description":"MageRubik blog site","publisher":{"@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8"},"alternateName":"Magento 2 Extension","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/magerubik.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/dad797dc557c925c92436706db1359d8","name":"Hilary howard","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magerubik-logo.png","contentUrl":"https:\/\/magerubik.com\/blog\/wp-content\/uploads\/2022\/03\/magerubik-logo.png","width":265,"height":90,"caption":"Hilary howard"},"logo":{"@id":"https:\/\/magerubik.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/localhost\/blog","https:\/\/www.facebook.com\/magerubik","https:\/\/www.instagram.com\/magerubik","https:\/\/www.linkedin.com\/magerubik","https:\/\/www.pinterest.com\/magerubik","https:\/\/twitter.com\/https:\/\/www.twitter.com\/magerubik","https:\/\/www.myspace.com\/magerubik","https:\/\/www.youtube.com\/magerubik","https:\/\/www.soundcloud.com\/magerubik","https:\/\/www.tumblr.com\/magerubik","https:\/\/www.wikipedia.com\/magerubik"],"url":"https:\/\/magerubik.com\/blog\/author\/hilary-howard\/"}]}},"_links":{"self":[{"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":23,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":629,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions\/629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/media\/318"}],"wp:attachment":[{"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/magerubik.com\/blog\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}