Esempio n. 1
0
 /**
  * Prepares sort order of custom file
  *
  * @param \Magento\Framework\View\Design\Theme\FileInterface $file
  * @return void
  */
 protected function _prepareSortOrder(\Magento\Framework\View\Design\Theme\FileInterface $file)
 {
     $customFiles = $file->getTheme()->getCustomization()->getFilesByType($this->getType());
     $sortOrderIndex = (int) $file->getData('sort_order');
     foreach ($customFiles as $customFile) {
         $prevSortOrderIndex = $customFile->getData('sort_order');
         if ($prevSortOrderIndex > $sortOrderIndex) {
             $sortOrderIndex = $prevSortOrderIndex;
         }
     }
     $file->setData('sort_order', ++$sortOrderIndex);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function _prepareSortOrder(\Magento\Framework\View\Design\Theme\FileInterface $file)
 {
     $file->setData('sort_order', self::SORT_ORDER);
 }