Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableQuery::process_limit()privateWC 1.0

Generates the limits to be used in the LIMIT clause.

Метод класса: OrdersTableQuery{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->process_limit(): void;

Код OrdersTableQuery::process_limit() WC 8.7.0

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 );
}