| @@ 266-274 (lines=9) @@ | ||
| 263 | * @param array $config Full sync configuration for this sync module. |
|
| 264 | * @return array Number of items yet to be enqueued. |
|
| 265 | */ |
|
| 266 | public function estimate_full_sync_actions( $config ) { |
|
| 267 | global $wpdb; |
|
| 268 | ||
| 269 | $query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
|
| 270 | // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
|
| 271 | $count = $wpdb->get_var( $query ); |
|
| 272 | ||
| 273 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 274 | } |
|
| 275 | ||
| 276 | /** |
|
| 277 | * Retrieve the WHERE SQL clause based on the module config. |
|
| @@ 253-261 (lines=9) @@ | ||
| 250 | * @param array $config Full sync configuration for this sync module. |
|
| 251 | * @return array Number of items yet to be enqueued. |
|
| 252 | */ |
|
| 253 | public function estimate_full_sync_actions( $config ) { |
|
| 254 | global $wpdb; |
|
| 255 | ||
| 256 | $query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
|
| 257 | // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
|
| 258 | $count = $wpdb->get_var( $query ); |
|
| 259 | ||
| 260 | return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
|
| 261 | } |
|
| 262 | ||
| 263 | /** |
|
| 264 | * Retrieve the WHERE SQL clause based on the module config. |
|