private function _generateIndex ($group, $id)
	{
		switch ($group) {
			case 'custom':
				$last = DateTimeHelper::toIso8601(
					SitemapRecord::find()->one()->dateUpdated
				);
				$pages = 1;
				break;

			case 'sections':
				$last = $this->_getUpdated(Entry::instance(), $id);
				$pages = $this->_getPageCount(Entry::instance(), $id);
				break;

			case 'categories':
				$last = $this->_getUpdated(Category::instance(), $id);
				$pages = $this->_getPageCount(Category::instance(), $id);
				break;

			default:
				$last = DateTimeHelper::currentUTCDateTime()->format('c');
				$pages = 1;
		}

		for ($i = 0; $i < $pages; ++$i)
		{
			$sitemap = $this->_document->createElement('sitemap');
			$this->_index->appendChild($sitemap);

			$loc = $this->_document->createElement(
				'loc',
				$this->_indexUrl($group, $id, $i)
			);
			$sitemap->appendChild($loc);

			$lastMod = $this->_document->createElement('lastmod', $last);
			$sitemap->appendChild($lastMod);
		}
	}
private function _generateIndex ($group, $id)
	{
		switch ($group) {
			case 'custom':
				$last = DateTimeHelper::toIso8601(
					SitemapRecord::find()->one()->dateUpdated
				);
				$pages = 1;
				break;

			case 'sections':
				$last = $this->_getUpdated(Entry::instance(), $id);
				$pages = $this->_getPageCount(Entry::instance(), $id);
				break;

			case 'categories':
				$last = $this->_getUpdated(Category::instance(), $id);
				$pages = $this->_getPageCount(Category::instance(), $id);
				break;

			default:
				$last = DateTimeHelper::currentUTCDateTime()->format('c');
				$pages = 1;
		}

		for ($i = 0; $i < $pages; ++$i)
		{
			$sitemap = $this->_document->createElement('sitemap');
			$this->_index->appendChild($sitemap);

			$loc = $this->_document->createElement(
				'loc',
				$this->_indexUrl($group, $id, $i)
			);
			$sitemap->appendChild($loc);

			$lastMod = $this->_document->createElement('lastmod', $last);
			$sitemap->appendChild($lastMod);
		}
	}
private function _generateIndex ( $ group , $ id ) { switch ( $ group ) { case 'custom' : $ last = DateTimeHelper :: toIso8601 ( SitemapRecord :: find ( ) -> one ( ) -> dateUpdated ) ; $ pages = 1 ; break ; case 'sections' : $ last = $ this -> _getUpdated ( Entry :: instance ( ) , $ id ) ; $ pages = $ this -> _getPageCount ( Entry :: instance ( ) , $ id ) ; break ; case 'categories' : $ last = $ this -> _getUpdated ( Category :: instance ( ) , $ id ) ; $ pages = $ this -> _getPageCount ( Category :: instance ( ) , $ id ) ; break ; default : $ last = DateTimeHelper :: currentUTCDateTime ( ) -> format ( 'c' ) ; $ pages = 1 ; } for ( $ i = 0 ; $ i < $ pages ; ++ $ i ) { $ sitemap = $ this -> _document -> createElement ( 'sitemap' ) ; $ this -> _index -> appendChild ( $ sitemap ) ; $ loc = $ this -> _document -> createElement ( 'loc' , $ this -> _indexUrl ( $ group , $ id , $ i ) ) ; $ sitemap -> appendChild ( $ loc ) ; $ lastMod = $ this -> _document -> createElement ( 'lastmod' , $ last ) ; $ sitemap -> appendChild ( $ lastMod ) ; } }
@param $group
@param $id

@throws \yii\base\Exception
@param $group @param $id