private function loadSitemapTree($entity)
	{
		$em = $this->getEntityManager();
		
		$input = $this->getRequestInput();
		$localeId = $this->getCurrentLocale()->getId();

		// Parent ID and level
		$levels = null;
		$parentId = null;
		
		if ($input->has('parent_id')) {
			$parentId = $input->get('parent_id');

			// Special case for root page, need to fetch 2 levels
			if (empty($parentId)) {
				$levels = 2;
			} else {
				$levels = 1;
			}
		} else {
			$levels = 2;
		}

		$parentLocalization = null;
		$filter = null;

		if ( ! empty($parentId)) {

			if (strpos($parentId, '_') !== false) {
				list($parentId, $filter) = explode('_', $parentId);
			}

			// Find localization, special case for group pages
			if ($entity == Page::CN()) {
				$parentLocalization = $em->find(PageLocalization::CN(), $parentId);

				if (is_null($parentLocalization)) {
					$rootNode = $em->find($entity, $parentId);

					if ($rootNode instanceof GroupPage) {
						$parentLocalization = $rootNode->getLocalization($localeId);
					}
				}
			} else {
				$parentLocalization = $em->find(TemplateLocalization::CN(), $parentId);
			}

			if (is_null($parentLocalization)) {
				throw new CmsException(null, 'The page the children has been requested for was not found');
			}
		}

		$response = $this->gatherChildrenData($entity, $parentLocalization, $filter, $levels);

		return $response;
	}
private function loadSitemapTree($entity)
	{
		$em = $this->getEntityManager();
		
		$input = $this->getRequestInput();
		$localeId = $this->getCurrentLocale()->getId();

		// Parent ID and level
		$levels = null;
		$parentId = null;
		
		if ($input->has('parent_id')) {
			$parentId = $input->get('parent_id');

			// Special case for root page, need to fetch 2 levels
			if (empty($parentId)) {
				$levels = 2;
			} else {
				$levels = 1;
			}
		} else {
			$levels = 2;
		}

		$parentLocalization = null;
		$filter = null;

		if ( ! empty($parentId)) {

			if (strpos($parentId, '_') !== false) {
				list($parentId, $filter) = explode('_', $parentId);
			}

			// Find localization, special case for group pages
			if ($entity == Page::CN()) {
				$parentLocalization = $em->find(PageLocalization::CN(), $parentId);

				if (is_null($parentLocalization)) {
					$rootNode = $em->find($entity, $parentId);

					if ($rootNode instanceof GroupPage) {
						$parentLocalization = $rootNode->getLocalization($localeId);
					}
				}
			} else {
				$parentLocalization = $em->find(TemplateLocalization::CN(), $parentId);
			}

			if (is_null($parentLocalization)) {
				throw new CmsException(null, 'The page the children has been requested for was not found');
			}
		}

		$response = $this->gatherChildrenData($entity, $parentLocalization, $filter, $levels);

		return $response;
	}
private function loadSitemapTree ( $ entity ) { $ em = $ this -> getEntityManager ( ) ; $ input = $ this -> getRequestInput ( ) ; $ localeId = $ this -> getCurrentLocale ( ) -> getId ( ) ; // Parent ID and level $ levels = null ; $ parentId = null ; if ( $ input -> has ( 'parent_id' ) ) { $ parentId = $ input -> get ( 'parent_id' ) ; // Special case for root page, need to fetch 2 levels if ( empty ( $ parentId ) ) { $ levels = 2 ; } else { $ levels = 1 ; } } else { $ levels = 2 ; } $ parentLocalization = null ; $ filter = null ; if ( ! empty ( $ parentId ) ) { if ( strpos ( $ parentId , '_' ) !== false ) { list ( $ parentId , $ filter ) = explode ( '_' , $ parentId ) ; } // Find localization, special case for group pages if ( $ entity == Page :: CN ( ) ) { $ parentLocalization = $ em -> find ( PageLocalization :: CN ( ) , $ parentId ) ; if ( is_null ( $ parentLocalization ) ) { $ rootNode = $ em -> find ( $ entity , $ parentId ) ; if ( $ rootNode instanceof GroupPage ) { $ parentLocalization = $ rootNode -> getLocalization ( $ localeId ) ; } } } else { $ parentLocalization = $ em -> find ( TemplateLocalization :: CN ( ) , $ parentId ) ; } if ( is_null ( $ parentLocalization ) ) { throw new CmsException ( null , 'The page the children has been requested for was not found' ) ; } } $ response = $ this -> gatherChildrenData ( $ entity , $ parentLocalization , $ filter , $ levels ) ; return $ response ; }
Get list of pages converted to array
@param string $entity
@return array
Get list of pages converted to array