public function getPageChildrenByidPage($id, $publishedOnly = 0)
	{
		$select = $this->tableGateway->getSql()->select();
		
		$select->columns(array('*'));
		
		$select->join('melis_cms_page_lang', 'melis_cms_page_lang.plang_page_id = melis_cms_page_tree.tree_page_id', 
						array('plang_lang_id'));
		$select->join('melis_cms_lang', 'melis_cms_lang.lang_cms_id = melis_cms_page_lang.plang_lang_id', 
						array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_published', 'melis_cms_page_published.page_id = melis_cms_page_tree.tree_page_id', 
						array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_style', 'melis_cms_page_tree.tree_page_id = melis_cms_page_style.pstyle_page_id', array(), $select::JOIN_LEFT);
		
		$select->join('melis_cms_style', ' melis_cms_style.style_id = melis_cms_page_style.pstyle_style_id', array('*'), $select::JOIN_LEFT);
		
		if ($publishedOnly == 1)
			$select->where('melis_cms_page_published.page_status=1');
		
		if ($publishedOnly == 0)
		{
    		$columns = $this->aliasColumnsFromTableDefinition('MelisEngine\MelisPageColumns', 's_');
		    $select->join('melis_cms_page_saved', 'melis_cms_page_saved.page_id = melis_cms_page_tree.tree_page_id',
					$columns, $select::JOIN_LEFT);
		}
		
		$select->join('melis_cms_page_seo', 'melis_cms_page_seo.pseo_id = melis_cms_page_tree.tree_page_id',
	       array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_default_urls', 'melis_cms_page_default_urls.purl_page_id = melis_cms_page_tree.tree_page_id',
	       array('*'), $select::JOIN_LEFT);
			
		$select->where('tree_father_page_id = ' . $id);
		$select->order('tree_page_order ASC');
		
		$resultSet = $this->tableGateway->selectWith($select);
		
		return $resultSet;
	}
public function getPageChildrenByidPage($id, $publishedOnly = 0)
	{
		$select = $this->tableGateway->getSql()->select();
		
		$select->columns(array('*'));
		
		$select->join('melis_cms_page_lang', 'melis_cms_page_lang.plang_page_id = melis_cms_page_tree.tree_page_id', 
						array('plang_lang_id'));
		$select->join('melis_cms_lang', 'melis_cms_lang.lang_cms_id = melis_cms_page_lang.plang_lang_id', 
						array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_published', 'melis_cms_page_published.page_id = melis_cms_page_tree.tree_page_id', 
						array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_style', 'melis_cms_page_tree.tree_page_id = melis_cms_page_style.pstyle_page_id', array(), $select::JOIN_LEFT);
		
		$select->join('melis_cms_style', ' melis_cms_style.style_id = melis_cms_page_style.pstyle_style_id', array('*'), $select::JOIN_LEFT);
		
		if ($publishedOnly == 1)
			$select->where('melis_cms_page_published.page_status=1');
		
		if ($publishedOnly == 0)
		{
    		$columns = $this->aliasColumnsFromTableDefinition('MelisEngine\MelisPageColumns', 's_');
		    $select->join('melis_cms_page_saved', 'melis_cms_page_saved.page_id = melis_cms_page_tree.tree_page_id',
					$columns, $select::JOIN_LEFT);
		}
		
		$select->join('melis_cms_page_seo', 'melis_cms_page_seo.pseo_id = melis_cms_page_tree.tree_page_id',
	       array('*'), $select::JOIN_LEFT);
		
		$select->join('melis_cms_page_default_urls', 'melis_cms_page_default_urls.purl_page_id = melis_cms_page_tree.tree_page_id',
	       array('*'), $select::JOIN_LEFT);
			
		$select->where('tree_father_page_id = ' . $id);
		$select->order('tree_page_order ASC');
		
		$resultSet = $this->tableGateway->selectWith($select);
		
		return $resultSet;
	}
public function getPageChildrenByidPage ( $ id , $ publishedOnly = 0 ) { $ select = $ this -> tableGateway -> getSql ( ) -> select ( ) ; $ select -> columns ( array ( '*' ) ) ; $ select -> join ( 'melis_cms_page_lang' , 'melis_cms_page_lang.plang_page_id = melis_cms_page_tree.tree_page_id' , array ( 'plang_lang_id' ) ) ; $ select -> join ( 'melis_cms_lang' , 'melis_cms_lang.lang_cms_id = melis_cms_page_lang.plang_lang_id' , array ( '*' ) , $ select :: JOIN_LEFT ) ; $ select -> join ( 'melis_cms_page_published' , 'melis_cms_page_published.page_id = melis_cms_page_tree.tree_page_id' , array ( '*' ) , $ select :: JOIN_LEFT ) ; $ select -> join ( 'melis_cms_page_style' , 'melis_cms_page_tree.tree_page_id = melis_cms_page_style.pstyle_page_id' , array ( ) , $ select :: JOIN_LEFT ) ; $ select -> join ( 'melis_cms_style' , ' melis_cms_style.style_id = melis_cms_page_style.pstyle_style_id' , array ( '*' ) , $ select :: JOIN_LEFT ) ; if ( $ publishedOnly == 1 ) $ select -> where ( 'melis_cms_page_published.page_status=1' ) ; if ( $ publishedOnly == 0 ) { $ columns = $ this -> aliasColumnsFromTableDefinition ( 'MelisEngine\MelisPageColumns' , 's_' ) ; $ select -> join ( 'melis_cms_page_saved' , 'melis_cms_page_saved.page_id = melis_cms_page_tree.tree_page_id' , $ columns , $ select :: JOIN_LEFT ) ; } $ select -> join ( 'melis_cms_page_seo' , 'melis_cms_page_seo.pseo_id = melis_cms_page_tree.tree_page_id' , array ( '*' ) , $ select :: JOIN_LEFT ) ; $ select -> join ( 'melis_cms_page_default_urls' , 'melis_cms_page_default_urls.purl_page_id = melis_cms_page_tree.tree_page_id' , array ( '*' ) , $ select :: JOIN_LEFT ) ; $ select -> where ( 'tree_father_page_id = ' . $ id ) ; $ select -> order ( 'tree_page_order ASC' ) ; $ resultSet = $ this -> tableGateway -> selectWith ( $ select ) ; return $ resultSet ; }
Gets the children of a page

@param int $id parent page id
@param int $publishedOnly If true, only published children page will be brought back
Gets the children of a page