Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableStatusUnionQuery::where_matches_type_status_args
Checks the WHERE clause is exactly the one the 'type' and 'status' args generate (same order as OrdersTableQuery::process_orders_table_query_args()). Any other contribution — other query args or filters — disqualifies the query. Both columns are of the 'string' type per the OrdersTableDataStore column mappings.
Метод класса: OrdersTableStatusUnionQuery{}
Хуков нет.
Возвращает
bool. Whether the WHERE clause is exactly the type/status one.
Использование
// private - только в коде основоного (родительского) класса $result = $this->where_matches_type_status_args( $where ): bool;
- $where(строка) (обязательный)
- The WHERE clause (without the WHERE keyword).
Код OrdersTableStatusUnionQuery::where_matches_type_status_args() OrdersTableStatusUnionQuery::where matches type status args WC 11.2.2
private function where_matches_type_status_args( string $where ): bool {
$expected_where = '1=1';
foreach ( array( 'status', 'type' ) as $arg_key ) {
$clause = $this->query->where( $this->orders_table, $arg_key, '=', $this->query->get( $arg_key ), 'string' );
$expected_where .= " AND ({$clause})";
}
return $where === $expected_where;
}