コード例 #1
0
 public function testGetCustomDesignDate()
 {
     $dates = $this->_model->getCustomDesignDate();
     $this->assertArrayHasKey('from', $dates);
     $this->assertArrayHasKey('to', $dates);
 }
コード例 #2
0
ファイル: Design.php プロジェクト: shabbirvividads/magento2
 /**
  * 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;
 }
コード例 #3
0
 /**
  * {@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);
     }
 }