public function getChildrenRecursive($idPage)
	{
		$results = array();
		$melisTree = $this->serviceLocator->get('MelisEngineTree');
		
		$publishedOnly = 1;
		$pages = $melisTree->getPageChildren($idPage,$publishedOnly);

		if ($pages)
		{
		    $rpages = $pages->toArray();
			
			foreach ($rpages as $page)
			{

				$tmp = $this->formatPageInArray($page);
				$children = $this->getChildrenRecursive($page['tree_page_id']);

				if (!empty($children))
					$tmp['pages'] = $children;
				
				$results[] = $tmp;
			}
		}
		
		return $results;
	}
public function getChildrenRecursive($idPage)
	{
		$results = array();
		$melisTree = $this->serviceLocator->get('MelisEngineTree');
		
		$publishedOnly = 1;
		$pages = $melisTree->getPageChildren($idPage,$publishedOnly);

		if ($pages)
		{
		    $rpages = $pages->toArray();
			
			foreach ($rpages as $page)
			{

				$tmp = $this->formatPageInArray($page);
				$children = $this->getChildrenRecursive($page['tree_page_id']);

				if (!empty($children))
					$tmp['pages'] = $children;
				
				$results[] = $tmp;
			}
		}
		
		return $results;
	}
public function getChildrenRecursive ( $ idPage ) { $ results = array ( ) ; $ melisTree = $ this -> serviceLocator -> get ( 'MelisEngineTree' ) ; $ publishedOnly = 1 ; $ pages = $ melisTree -> getPageChildren ( $ idPage , $ publishedOnly ) ; if ( $ pages ) { $ rpages = $ pages -> toArray ( ) ; foreach ( $ rpages as $ page ) { $ tmp = $ this -> formatPageInArray ( $ page ) ; $ children = $ this -> getChildrenRecursive ( $ page [ 'tree_page_id' ] ) ; if ( ! empty ( $ children ) ) $ tmp [ 'pages' ] = $ children ; $ results [ ] = $ tmp ; } } return $ results ; }
Get subpages recursively

@param int $idPage
@return array Pages
Get subpages recursively