classes/Pods.php
public function next_id( $id = null, $params_override = null ) {

		if ( null === $id ) {
			$id = $this->id();
		}

		$id = (int) $id;

		$params = array(
			'select'  => "`t`.`{$this->data->field_id}`",
			'where'   => "{$id} < `t`.`{$this->data->field_id}`",
			'orderby' => "`t`.`{$this->data->field_id}` ASC",
			'limit'   => 1,
		);

		if ( ! empty( $params_override ) || ! empty( $this->params ) ) {
			if ( ! empty( $params_override ) ) {
				$params = $params_override;
			} elseif ( ! empty( $this->params ) ) {
				$params = $this->params;
			}

			if ( is_object( $params ) ) {
				$params = get_object_vars( $params );
			}

			if ( 0 < $id ) {
				if ( isset( $params['where'] ) && ! empty( $params['where'] ) ) {
					$params['where']   = (array) $params['where'];
					$params['where'][] = "{$id} < `t`.`{$this->data->field_id}`";
				} else {
					$params['where'] = "{$id} < `t`.`{$this->data->field_id}`";
				}
			} elseif ( ! isset( $params['offset'] ) ) {
				if ( ! empty( $this->params ) && - 1 < $this->row_number ) {
					$params['offset'] = $this->row_number + 1;
				} else {
					$params['offset'] = 1;
				}
			} else {
				$params['offset'] ++;
			}

			$params['select'] = "`t`.`{$this->data->field_id}`";
			$params['limit']  = 1;
		}//end if

		$pod = pods( $this->pod, $params );

		$new_id = 0;

		if ( $pod->fetch() ) {
			$new_id = $pod->id();
		}

		$new_id = $this->do_hook( 'next_id', $new_id, $id, $pod, $params_override );

		return $new_id;
	}
public function next_id( $id = null, $params_override = null ) {

		if ( null === $id ) {
			$id = $this->id();
		}

		$id = (int) $id;

		$params = array(
			'select'  => "`t`.`{$this->data->field_id}`",
			'where'   => "{$id} < `t`.`{$this->data->field_id}`",
			'orderby' => "`t`.`{$this->data->field_id}` ASC",
			'limit'   => 1,
		);

		if ( ! empty( $params_override ) || ! empty( $this->params ) ) {
			if ( ! empty( $params_override ) ) {
				$params = $params_override;
			} elseif ( ! empty( $this->params ) ) {
				$params = $this->params;
			}

			if ( is_object( $params ) ) {
				$params = get_object_vars( $params );
			}

			if ( 0 < $id ) {
				if ( isset( $params['where'] ) && ! empty( $params['where'] ) ) {
					$params['where']   = (array) $params['where'];
					$params['where'][] = "{$id} < `t`.`{$this->data->field_id}`";
				} else {
					$params['where'] = "{$id} < `t`.`{$this->data->field_id}`";
				}
			} elseif ( ! isset( $params['offset'] ) ) {
				if ( ! empty( $this->params ) && - 1 < $this->row_number ) {
					$params['offset'] = $this->row_number + 1;
				} else {
					$params['offset'] = 1;
				}
			} else {
				$params['offset'] ++;
			}

			$params['select'] = "`t`.`{$this->data->field_id}`";
			$params['limit']  = 1;
		}//end if

		$pod = pods( $this->pod, $params );

		$new_id = 0;

		if ( $pod->fetch() ) {
			$new_id = $pod->id();
		}

		$new_id = $this->do_hook( 'next_id', $new_id, $id, $pod, $params_override );

		return $new_id;
	}
public function next_id ( $ id = null , $ params_override = null ) { if ( null === $ id ) { $ id = $ this -> id ( ) ; } $ id = ( int ) $ id ; $ params = array ( 'select' => "`t`.`{$this->data->field_id}`" , 'where' => "{$id} < `t`.`{$this->data->field_id}`" , 'orderby' => "`t`.`{$this->data->field_id}` ASC" , 'limit' => 1 , ) ; if ( ! empty ( $ params_override ) || ! empty ( $ this -> params ) ) { if ( ! empty ( $ params_override ) ) { $ params = $ params_override ; } elseif ( ! empty ( $ this -> params ) ) { $ params = $ this -> params ; } if ( is_object ( $ params ) ) { $ params = get_object_vars ( $ params ) ; } if ( 0 < $ id ) { if ( isset ( $ params [ 'where' ] ) && ! empty ( $ params [ 'where' ] ) ) { $ params [ 'where' ] = ( array ) $ params [ 'where' ] ; $ params [ 'where' ] [ ] = "{$id} < `t`.`{$this->data->field_id}`" ; } else { $ params [ 'where' ] = "{$id} < `t`.`{$this->data->field_id}`" ; } } elseif ( ! isset ( $ params [ 'offset' ] ) ) { if ( ! empty ( $ this -> params ) && - 1 < $ this -> row_number ) { $ params [ 'offset' ] = $ this -> row_number + 1 ; } else { $ params [ 'offset' ] = 1 ; } } else { $ params [ 'offset' ] ++ ; } $ params [ 'select' ] = "`t`.`{$this->data->field_id}`" ; $ params [ 'limit' ] = 1 ; } //end if $ pod = pods ( $ this -> pod , $ params ) ; $ new_id = 0 ; if ( $ pod -> fetch ( ) ) { $ new_id = $ pod -> id ( ) ; } $ new_id = $ this -> do_hook ( 'next_id' , $ new_id , $ id , $ pod , $ params_override ) ; return $ new_id ; }
Return the next item ID, loops at the first id to return the last

@param int|null          $id              ID to start from.
@param array|object|null $params_override Override the find() parameters.

@return int
@since 2.0.0
Return the next item ID loops at the first id to return the last