Example #1
0
 /**
  * Recursively apply design
  *
  * @deprecated after 1.4.2.0-beta1
  *
  * @param Varien_Object $object
  * @param int $calledFrom
  *
  * @return Mage_Catalog_Model_Design
  */
 protected function _inheritDesign($object, $calledFrom = 0)
 {
     $useParentSettings = false;
     if ($object instanceof Mage_Catalog_Model_Product) {
         $category = $object->getCategory();
         if ($category && $category->getId()) {
             return $this->_inheritDesign($category, $calledFrom);
         }
     } elseif ($object instanceof Mage_Catalog_Model_Category) {
         $category = $object->getParentCategory();
         $useParentSettings = $object->getCustomUseParentSettings();
         if ($useParentSettings) {
             if ($category && $category->getId() && $category->getLevel() > 1 && $category->getId() != Mage_Catalog_Model_Category::TREE_ROOT_ID) {
                 return $this->_inheritDesign($category, $calledFrom);
             }
         }
         if ($calledFrom == self::APPLY_FOR_PRODUCT) {
             $applyToProducts = $object->getCustomApplyToProducts();
             if (!$applyToProducts) {
                 return $this;
             }
         }
     }
     if (!$useParentSettings) {
         $design = $object->getCustomDesign();
         $date = $object->getCustomDesignDate();
         $this->_isApplyDesign($design, $date);
     }
     return $this;
 }