{"id":85867,"date":"2017-06-09T15:24:13","date_gmt":"2017-06-09T15:24:13","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=85867"},"modified":"2017-06-09T15:24:13","modified_gmt":"2017-06-09T15:24:13","slug":"use-factory-design-pattern","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/","title":{"rendered":"How to Use Factory Design Pattern"},"content":{"rendered":"<p><strong>Design Pattern :-<\/strong> Design Pattern is a way to represent your useful code and project in a well defined manner by following some standard pattern\u00a0 and also used for encapsulating the large data for your project.<\/p>\n<p>Today we will focus on one of the useful and commonly used design pattern i.e Factory Design Pattern.<\/p>\n<p><strong>Factory Design Pattern<\/strong><\/p>\n<p>Basically, Factory is a way to return the object of other classes. In Factory classes we simply create the the static methods inside these methods we can create object of other class.<\/p>\n<p>In the below example, We create a file cart.php in which we used a class named Cart to get and set the information of customer and products. In cart class we used getName() and setName() functions for customer details,\u00a0 getProductDetails() and setProductDetails() functioned for product details.<\/p>\n<pre class=\"brush:php\">&lt;?php\r\n\r\n\/**\r\n * @category Webkul\r\n * @package Factory Design Pattern\r\n * @author [Webkul] &lt;[&lt;http:\/\/webkul.com\/&gt;]&gt;\r\n * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited\r\n (https:\/\/webkul.com)\r\n * @license https:\/\/store.webkul.com\/license.html\r\n *\/\r\n\r\n  \/**\r\n   * Cart Class contains Functions get, set, showCustomerDetails and showProductDetails\r\n   * This class is used for displaying the customer and Product data\r\n   *\/\r\n    abstract class Cart\r\n    {\r\n      private $customer_name;\r\n      private $product_details = array();\r\n\r\n        public function getName(){\r\n            return $this-&gt;customer_name;\r\n        }\r\n\r\n        public function setName($cust_name){\r\n            $this-&gt;customer_name = $cust_name;\r\n        }\r\n\r\n        public function getProductDetails(){\r\n            return $this-&gt;product_details;\r\n        }\r\n\r\n        public function setProductDetails($prod_details){\r\n            if(!empty($prod_details)){\r\n                $this-&gt;product_details = $prod_details;\r\n            }\r\n        }\r\n\r\n        public function showCustomerDetails(){\r\n            print_r('Customer Name :- '.$this-&gt;getName().'&lt;br&gt;');\r\n        }\r\n\r\n        public function showProductDetails(){\r\n            foreach ($this-&gt;getProductDetails() as $key =&gt; $product) {\r\n                print_r('&lt;br&gt;Product : '.$product['name']. ' Price : '.$product['price'].'&lt;br&gt;');\r\n            }\r\n        }\r\n    }\r\n ?&gt;\r\n<\/pre>\n<p>We also used <strong>showCustomerDetails<\/strong>() and <strong>showProductDetails<\/strong>() functions<br \/>\nto print the output of customer name and product details respectively.<\/p>\n<p>We <strong>extends<\/strong> the above class i.e. <strong>Cart<\/strong> into <strong>CartDetails<\/strong> Class, that is defined<br \/>\nin other file named <strong>cart_details.php<\/strong>.<\/p>\n<pre class=\"brush:php\">&lt;?php\r\n   include 'cart.php';\r\n\r\n      \/**\r\n       * @category Webkul\r\n       * @package Factory Design Pattern\r\n       * @author [Webkul] &lt;[&lt;http:\/\/webkul.com\/&gt;]&gt;\r\n       * @copyright Copyright (c) 2010-2017 Webkul Software Private Limited (https:\/\/webkul.com)\r\n       * @license https:\/\/store.webkul.com\/license.html\r\n       *\/\r\n\r\n       \/**\r\n        * CartDetails to set the data for Cart class i.e. parent class\r\n        *\/\r\n      class CartDetails extends Cart\r\n      {\r\n          function __construct()\r\n          {\r\n              parent::setName('John Doe');\r\n              parent::setProductDetails(array(array('name' =&gt; 'Mac Book', 'price' =&gt; '$65'),array('name' =&gt; 'samsung j7', 'price' =&gt; '$40'),array('name' =&gt; 'Canon EOS 5D', 'price' =&gt; '$15')));\r\n          }\r\n      }\r\n\r\n      \/**\r\n       * CartFactory this is a Factory class for Cart class\r\n       *\/\r\n      class CartFactory\r\n      {\r\n\r\n          public static function createObject(){\r\n              \/**\r\n               * Here we create Object of CartDetails Class i.e. new CartDetails(), Inside the createObject() of CartFactory Class\r\n               *\/\r\n              $cart_obj = new CartDetails();\r\n              CartFactory::printDetails($cart_obj);\r\n          }\r\n\r\n          public static function printDetails($cart_obj){\r\n              $cart_obj-&gt;showCustomerDetails();\r\n              $cart_obj-&gt;showProductDetails();\r\n          }\r\n      }\r\n\r\n      \/\/ Calling Factory Class Function\r\n      CartFactory::createObject();\r\n ?&gt;\r\n<\/pre>\n<p>In CartDetails class, we defined a non parameterized constructor and called<br \/>\n<strong>setName<\/strong>() and <strong>setProductDetails<\/strong>() functions to set the customer and product<br \/>\ndata.<\/p>\n<p>Here we used Factory class named <strong>CartFactory<\/strong> Class inside <strong>cart_details.php<\/strong><br \/>\nIn <strong>CartFactory<\/strong> class we used two static methods named : <strong>createObject<\/strong>() and<br \/>\n<strong>printDetails<\/strong>()<\/p>\n<p>If you will see in above <strong>CartFactory<\/strong> class, we create an object of <strong>CartDetails<\/strong><br \/>\nclass like:<\/p>\n<pre class=\"brush:php\">public static function createObject(){\r\n    \/**\r\n      * Here we create Object of CartDetails Class i.e. new CartDetails(), Inside the createObject() of CartFactory Class\r\n      *\/\r\n      $cart_obj = new CartDetails();\r\n      CartFactory::printDetails($cart_obj);\r\n\r\n}<\/pre>\n<p>and by using this object, called the printDetails($cart_obj) function of CartFactory class. Now with the help of $cart_obj object you can call functions of CartDetails and Cart classes.<\/p>\n<p><strong>Like:-<\/strong><\/p>\n<pre class=\"brush:php\">public static function printDetails($cart_obj){\r\n     $cart_obj-&gt;showCustomerDetails();\r\n     $cart_obj-&gt;showProductDetails();\r\n}\r\n\r\nOutput:-\r\n\r\n   Customer Name :- John Doe\r\n   Product : Mac Book Price : $65\r\n   Product : samsung j7 Price : $40\r\n   Product : Canon EOS 5D Price : $15<\/pre>\n<p><strong>Benefits of using Factory Design Pattern:-<\/strong><\/p>\n<p>1) By using Factory Design Pattern like in above example if you want to change<br \/>\nsome code in Cart and CartDesigns classes, then you have to<strong> change code only<\/strong><br \/>\n<strong>in Factory class,<\/strong> instead of in complete project where you used Cart and CartDesigns<br \/>\nclasses.<\/p>\n<p>2) By using Factory classes you can <strong>encapsulate your code\/data.<\/strong><\/p>\n<p>3) You can also <strong>reduce the code repetition<\/strong> while <strong>creating the object<\/strong> of<br \/>\nother classes.<\/p>\n<p><strong>Thanks \ud83d\ude42<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Design Pattern :- Design Pattern is a way to represent your useful code and project in a well defined manner by following some standard pattern\u00a0 and also used for encapsulating the large data for your project. Today we will focus on one of the useful and commonly used design pattern i.e Factory Design Pattern. Factory <a href=\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":34,"featured_media":84482,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3671,4907,4908],"class_list":["post-85867","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-design-pattern","tag-factory-design-pattern","tag-php-design-pattern"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use Factory Design Pattern - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Factory Design Pattern - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Design Pattern :- Design Pattern is a way to represent your useful code and project in a well defined manner by following some standard pattern\u00a0 and also used for encapsulating the large data for your project. Today we will focus on one of the useful and commonly used design pattern i.e Factory Design Pattern. Factory [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-09T15:24:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vivek Sharma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vivek Sharma\" \/>\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:\/\/webkul.com\/blog\/use-factory-design-pattern\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\"},\"author\":{\"name\":\"Vivek Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/55a090ee89f2ea288152d9618972d51a\"},\"headline\":\"How to Use Factory Design Pattern\",\"datePublished\":\"2017-06-09T15:24:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\"},\"wordCount\":352,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png\",\"keywords\":[\"design pattern\",\"Factory Design Pattern\",\"PHP Design Pattern\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\",\"url\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\",\"name\":\"How to Use Factory Design Pattern - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png\",\"datePublished\":\"2017-06-09T15:24:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png\",\"width\":\"825\",\"height\":\"260\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Factory Design Pattern\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/55a090ee89f2ea288152d9618972d51a\",\"name\":\"Vivek Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/016ec12a9caaedb7c6003878edfc412b2e9a5159e75bac4338ab7eeaaec9d92d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/016ec12a9caaedb7c6003878edfc412b2e9a5159e75bac4338ab7eeaaec9d92d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Vivek Sharma\"},\"sameAs\":[\"https:\/\/store.webkul.com\/\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/viveksh047\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Factory Design Pattern - Webkul Blog","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:\/\/webkul.com\/blog\/use-factory-design-pattern\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Factory Design Pattern - Webkul Blog","og_description":"Design Pattern :- Design Pattern is a way to represent your useful code and project in a well defined manner by following some standard pattern\u00a0 and also used for encapsulating the large data for your project. Today we will focus on one of the useful and commonly used design pattern i.e Factory Design Pattern. Factory [...]","og_url":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-06-09T15:24:13+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png","type":"image\/png"}],"author":"Vivek Sharma","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Vivek Sharma","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/"},"author":{"name":"Vivek Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/55a090ee89f2ea288152d9618972d51a"},"headline":"How to Use Factory Design Pattern","datePublished":"2017-06-09T15:24:13+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/"},"wordCount":352,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png","keywords":["design pattern","Factory Design Pattern","PHP Design Pattern"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/","url":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/","name":"How to Use Factory Design Pattern - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png","datePublished":"2017-06-09T15:24:13+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/use-factory-design-pattern\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/05\/Code-Snippet.png","width":"825","height":"260"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/use-factory-design-pattern\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Factory Design Pattern"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/55a090ee89f2ea288152d9618972d51a","name":"Vivek Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/016ec12a9caaedb7c6003878edfc412b2e9a5159e75bac4338ab7eeaaec9d92d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/016ec12a9caaedb7c6003878edfc412b2e9a5159e75bac4338ab7eeaaec9d92d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Vivek Sharma"},"sameAs":["https:\/\/store.webkul.com\/"],"url":"https:\/\/webkul.com\/blog\/author\/viveksh047\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/85867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=85867"}],"version-history":[{"count":3,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/85867\/revisions"}],"predecessor-version":[{"id":86012,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/85867\/revisions\/86012"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/84482"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=85867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=85867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=85867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}