Пример #1
0
 /**
  * Check if passed node available for store in case this node representation of page.
  * If node does not represent page then method will return true.
  *
  * @param Enterprise_Cms_Model_Hierarchy_Node $node
  * @param null|int $store
  * @return bool
  */
 public function isNodeAvailableForStore($node, $store)
 {
     if (!$node->getPageId()) {
         return true;
     }
     if (!$store) {
         return true;
     }
     if ($node->getPageInStores() == '0') {
         return true;
     }
     $stores = explode(',', $node->getPageInStores());
     if (in_array($store, $stores)) {
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * Load page data for model if defined page id
  *
  * @param Enterprise_Cms_Model_Hierarchy_Node $object
  * @return Enterprise_Cms_Model_Resource_Hierarchy_Node
  */
 public function loadPageData($object)
 {
     $pageId = $object->getPageId();
     if (!empty($pageId)) {
         $columns = array('page_title' => 'title', 'page_identifier' => 'identifier', 'page_is_active' => 'is_active');
         $select = $this->_getReadAdapter()->select()->from($this->getTable('cms/page'), $columns)->where('page_id=?', $pageId)->limit(1);
         $row = $this->_getReadAdapter()->fetchRow($select);
         if ($row) {
             $object->addData($row);
         }
     }
     return $this;
 }