コード例 #1
0
 /**
  * Return children ids of page
  *
  * @access public
  * @param Ibrams_CmsExtended_Model_Page $page
  * @param boolean $recursive
  * @return array
  * @author Ultimate Module Creator
  */
 public function getChildren($page, $recursive = true)
 {
     $bind = array('c_path' => $page->getPath() . '/%');
     $select = $this->_getReadAdapter()->select()->from(array('m' => $this->getMainTable()), 'entity_id')->where('status = ?', 1)->where($this->_getReadAdapter()->quoteIdentifier('path') . ' LIKE :c_path');
     if (!$recursive) {
         $select->where($this->_getReadAdapter()->quoteIdentifier('level') . ' <= :c_level');
         $bind['c_level'] = $page->getLevel() + 1;
     }
     return $this->_getReadAdapter()->fetchCol($select, $bind);
 }