|
| __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\View\DesignInterface $design, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) |
|
| applyCustomDesign ($design) |
|
| getDesignSettings ($object) |
|
| __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[]) |
|
| __sleep () |
|
| __wakeup () |
|
| setIdFieldName ($name) |
|
| getIdFieldName () |
|
| getId () |
|
| setId ($value) |
|
| isDeleted ($isDeleted=null) |
|
| hasDataChanges () |
|
| setData ($key, $value=null) |
|
| unsetData ($key=null) |
|
| setDataChanges ($value) |
|
| getOrigData ($key=null) |
|
| setOrigData ($key=null, $data=null) |
|
| dataHasChangedFor ($field) |
|
| getResourceName () |
|
| getResourceCollection () |
|
| getCollection () |
|
| load ($modelId, $field=null) |
|
| beforeLoad ($identifier, $field=null) |
|
| afterLoad () |
|
| isSaveAllowed () |
|
| setHasDataChanges ($flag) |
|
| save () |
|
| afterCommitCallback () |
|
| isObjectNew ($flag=null) |
|
| beforeSave () |
|
| validateBeforeSave () |
|
| getCacheTags () |
|
| cleanModelCache () |
|
| afterSave () |
|
| delete () |
|
| beforeDelete () |
|
| afterDelete () |
|
| afterDeleteCommit () |
|
| getResource () |
|
| getEntityId () |
|
| setEntityId ($entityId) |
|
| clearInstance () |
|
| getStoredData () |
|
| getEventPrefix () |
|
| __construct (array $data=[]) |
|
| addData (array $arr) |
|
| setData ($key, $value=null) |
|
| unsetData ($key=null) |
|
| getData ($key='', $index=null) |
|
| getDataByPath ($path) |
|
| getDataByKey ($key) |
|
| setDataUsingMethod ($key, $args=[]) |
|
| getDataUsingMethod ($key, $args=null) |
|
| hasData ($key='') |
|
| toArray (array $keys=[]) |
|
| convertToArray (array $keys=[]) |
|
| toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) |
|
| convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) |
|
| toJson (array $keys=[]) |
|
| convertToJson (array $keys=[]) |
|
| toString ($format='') |
|
| __call ($method, $args) |
|
| isEmpty () |
|
| serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') |
|
| debug ($data=null, &$objects=[]) |
|
| offsetSet ($offset, $value) |
|
| offsetExists ($offset) |
|
| offsetUnset ($offset) |
|
| offsetGet ($offset) |
|
◆ __construct()
- Parameters
-
\Magento\Framework\Model\Context | $context | |
\Magento\Framework\Registry | $registry | |
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate | |
\Magento\Framework\View\DesignInterface | $design | |
\Magento\Framework\Model\ResourceModel\AbstractResource | $resource | |
\Magento\Framework\Data\Collection\AbstractDb | $resourceCollection | |
array | $data | |
Definition at line 43 of file Design.php.
52 $this->_localeDate = $localeDate;
53 $this->_design = $design;
◆ _extractSettings()
_extractSettings |
( |
|
$object | ) |
|
|
protected |
Extract custom layout settings from category or product object
- Parameters
-
\Magento\Catalog\Model\Category | \Magento\Catalog\Model\Product | $object | |
- Returns
- \Magento\Framework\DataObject
Definition at line 105 of file Design.php.
107 $settings = new \Magento\Framework\DataObject();
111 $date = $object->getCustomDesignDate();
112 if (array_key_exists(
115 ) && array_key_exists(
118 ) && $this->_localeDate->isScopeDateInInterval(
125 $object->getCustomDesign()
127 $object->getPageLayout()
129 (array)$object->getCustomLayoutUpdate()
◆ _mergeSettings()
_mergeSettings |
( |
|
$categorySettings, |
|
|
|
$productSettings |
|
) |
| |
|
protected |
Merge custom design settings
- Parameters
-
\Magento\Framework\DataObject | $categorySettings | |
\Magento\Framework\DataObject | $productSettings | |
- Returns
- \Magento\Framework\DataObject
Definition at line 142 of file Design.php.
144 if ($productSettings->getCustomDesign()) {
145 $categorySettings->setCustomDesign($productSettings->getCustomDesign());
147 if ($productSettings->getPageLayout()) {
148 $categorySettings->setPageLayout($productSettings->getPageLayout());
150 if ($productSettings->getLayoutUpdates()) {
151 $update = array_merge($categorySettings->getLayoutUpdates(), $productSettings->getLayoutUpdates());
152 $categorySettings->setLayoutUpdates($update);
154 return $categorySettings;
◆ applyCustomDesign()
applyCustomDesign |
( |
|
$design | ) |
|
Apply custom design
- Parameters
-
- Returns
- $this
Definition at line 63 of file Design.php.
65 $this->_design->setDesignTheme($design);
◆ getDesignSettings()
getDesignSettings |
( |
|
$object | ) |
|
Get custom layout settings
- Parameters
-
\Magento\Catalog\Model\Category | \Magento\Catalog\Model\Product | $object | |
- Returns
- \Magento\Framework\DataObject
Definition at line 75 of file Design.php.
77 if ($object instanceof \
Magento\Catalog\Model\Product) {
78 $currentCategory = $object->getCategory();
80 $currentCategory = $object;
84 if ($currentCategory) {
85 $category = $currentCategory->getParentDesignCategory($currentCategory);
88 if ($object instanceof \
Magento\Catalog\Model\Product) {
_mergeSettings($categorySettings, $productSettings)
_extractSettings($object)
◆ $_design
◆ $_localeDate
◆ APPLY_FOR_CATEGORY
const APPLY_FOR_CATEGORY = 2 |
◆ APPLY_FOR_PRODUCT
const APPLY_FOR_PRODUCT = 1 |
The documentation for this class was generated from the following file: