public function testGetCustomDesignDate() { $dates = $this->_model->getCustomDesignDate(); $this->assertArrayHasKey('from', $dates); $this->assertArrayHasKey('to', $dates); }
/** * Extract custom layout settings from category or product object * * @param \Magento\Catalog\Model\Category|\Magento\Catalog\Model\Product $object * @return \Magento\Framework\Object */ protected function _extractSettings($object) { $settings = new \Magento\Framework\Object(); if (!$object) { return $settings; } $date = $object->getCustomDesignDate(); if (array_key_exists('from', $date) && array_key_exists('to', $date) && $this->_localeDate->isScopeDateInInterval(null, $date['from'], $date['to'])) { $settings->setCustomDesign($object->getCustomDesign())->setPageLayout($object->getPageLayout())->setLayoutUpdates((array) $object->getCustomLayoutUpdate()); } return $settings; }
/** * {@inheritdoc} */ public function getCustomDesignDate() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCustomDesignDate'); if (!$pluginInfo) { return parent::getCustomDesignDate(); } else { return $this->___callPlugins('getCustomDesignDate', func_get_args(), $pluginInfo); } }