protected function runQuery( $params, $contName, $resName, $pageIdName = 'pageid', $cont = true ) {
		$pages = new Pages();
		$negativeId = -1;

		do {
			// Set up continue parameter if it's been set already.
			if ( isset( $result['continue'][$contName] ) ) {
				$params[$contName] = $result['continue'][$contName];
			}

			// Run the actual query.
			$result = $this->api->getRequest( new SimpleRequest( 'query', $params ) );
			if ( !array_key_exists( 'query', $result ) ) {
				return $pages;
			}

			// Add the results to the output page list.
			foreach ( $result['query'][$resName] as $member ) {
				// Assign negative pageid if page is non-existent.
				if ( !array_key_exists( $pageIdName, $member ) ) {
					$member[$pageIdName] = $negativeId;
					$negativeId = $negativeId - 1;
				}

				$pageTitle = new Title( $member['title'], $member['ns'] );
				$page = new Page( new PageIdentifier( $pageTitle, $member[$pageIdName] ) );
				$pages->addPage( $page );
			}

		} while ( $cont && isset( $result['continue'] ) );

		return $pages;
	}
protected function runQuery( $params, $contName, $resName, $pageIdName = 'pageid', $cont = true ) {
		$pages = new Pages();
		$negativeId = -1;

		do {
			// Set up continue parameter if it's been set already.
			if ( isset( $result['continue'][$contName] ) ) {
				$params[$contName] = $result['continue'][$contName];
			}

			// Run the actual query.
			$result = $this->api->getRequest( new SimpleRequest( 'query', $params ) );
			if ( !array_key_exists( 'query', $result ) ) {
				return $pages;
			}

			// Add the results to the output page list.
			foreach ( $result['query'][$resName] as $member ) {
				// Assign negative pageid if page is non-existent.
				if ( !array_key_exists( $pageIdName, $member ) ) {
					$member[$pageIdName] = $negativeId;
					$negativeId = $negativeId - 1;
				}

				$pageTitle = new Title( $member['title'], $member['ns'] );
				$page = new Page( new PageIdentifier( $pageTitle, $member[$pageIdName] ) );
				$pages->addPage( $page );
			}

		} while ( $cont && isset( $result['continue'] ) );

		return $pages;
	}
protected function runQuery ( $ params , $ contName , $ resName , $ pageIdName = 'pageid' , $ cont = true ) { $ pages = new Pages ( ) ; $ negativeId = - 1 ; do { // Set up continue parameter if it's been set already. if ( isset ( $ result [ 'continue' ] [ $ contName ] ) ) { $ params [ $ contName ] = $ result [ 'continue' ] [ $ contName ] ; } // Run the actual query. $ result = $ this -> api -> getRequest ( new SimpleRequest ( 'query' , $ params ) ) ; if ( ! array_key_exists ( 'query' , $ result ) ) { return $ pages ; } // Add the results to the output page list. foreach ( $ result [ 'query' ] [ $ resName ] as $ member ) { // Assign negative pageid if page is non-existent. if ( ! array_key_exists ( $ pageIdName , $ member ) ) { $ member [ $ pageIdName ] = $ negativeId ; $ negativeId = $ negativeId - 1 ; } $ pageTitle = new Title ( $ member [ 'title' ] , $ member [ 'ns' ] ) ; $ page = new Page ( new PageIdentifier ( $ pageTitle , $ member [ $ pageIdName ] ) ) ; $ pages -> addPage ( $ page ) ; } } while ( $ cont && isset ( $ result [ 'continue' ] ) ) ; return $ pages ; }
Run a query to completion.

@param string[] $params Query parameters
@param string $contName Result subelement name for continue details
@param string $resName Result element name for main results array
@param string $pageIdName Result element name for page ID
@param bool $cont Whether to continue the query, using multiple requests
@return Pages
Run a query to completion .