Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::process_limit()privateWC 1.0

Generates the limits to be used in the LIMIT clause.

Method of the class: OrdersTableQuery{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->process_limit(): void;

OrdersTableQuery::process_limit() code WC 7.1.1

private function process_limit(): void {
	$row_count = ( $this->arg_isset( 'limit' ) ? (int) $this->args['limit'] : false );
	$page      = ( $this->arg_isset( 'page' ) ? absint( $this->args['page'] ) : 1 );
	$offset    = ( $this->arg_isset( 'offset' ) ? absint( $this->args['offset'] ) : false );

	// Bool false indicates no limit was specified; less than -1 means an invalid value was passed (such as -3).
	if ( false === $row_count || $row_count < -1 ) {
		return;
	}

	if ( false === $offset && $row_count > -1 ) {
		$offset = (int) ( ( $page - 1 ) * $row_count );
	}

	$this->limits = array( $offset, $row_count );
}