22 private $layoutUpdateCache;
45 $this->
_init(
'layout_update',
'layout_update_id');
61 $bind = [
'theme_id' =>
$theme->getId(),
'store_id' =>
$store->getId()];
62 $cacheKey = implode(
'-', $bind);
63 if (!isset($this->layoutUpdateCache[$cacheKey])) {
64 $this->layoutUpdateCache[$cacheKey] = [];
66 if (!isset($this->layoutUpdateCache[$cacheKey][$layout[
'handle']])) {
67 $this->layoutUpdateCache[$cacheKey][$layout[
'handle']] =
'';
69 $this->layoutUpdateCache[$cacheKey][$layout[
'handle']] .= $layout[
'xml'];
72 return isset($this->layoutUpdateCache[$cacheKey][
$handle]) ? $this->layoutUpdateCache[$cacheKey][
$handle] :
'';
91 [
'link' => $this->
getTable(
'layout_link')],
92 'link.layout_update_id=layout_update.layout_update_id',
95 'link.store_id IN (0, :store_id)' 97 'link.theme_id = :theme_id' 99 'layout_update.sort_order ' . \
Magento\Framework\DB\Select::SQL_ASC
102 if (!$loadAllUpdates) {
103 $select->where(
'link.is_temporary = 0');
117 $data = $object->getData();
118 if (isset(
$data[
'store_id']) && isset(
$data[
'theme_id'])) {
122 'store_id' =>
$data[
'store_id'],
123 'theme_id' =>
$data[
'theme_id'],
124 'layout_update_id' => $object->getId(),
125 'is_temporary' => (int)$object->getIsTemporary()
129 $this->_cache->clean();
130 return parent::_afterSave($object);
_init($mainTable, $idFieldName)