packages/sync/src/modules/WooCommerce.php 1 location
|
@@ 252-259 (lines=8) @@
|
| 249 |
|
* @param array $config Full sync configuration for this sync module. |
| 250 |
|
* @return array Number of items yet to be enqueued. |
| 251 |
|
*/ |
| 252 |
|
public function estimate_full_sync_actions( $config ) { |
| 253 |
|
global $wpdb; |
| 254 |
|
|
| 255 |
|
$query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config ); |
| 256 |
|
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 257 |
|
$count = $wpdb->get_var( $query ); |
| 258 |
|
|
| 259 |
|
return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
/** |
packages/sync/src/modules/Posts.php 1 location
|
@@ 218-225 (lines=8) @@
|
| 215 |
|
* @param array $config Full sync configuration for this sync module. |
| 216 |
|
* @return array Number of items yet to be enqueued. |
| 217 |
|
*/ |
| 218 |
|
public function estimate_full_sync_actions( $config ) { |
| 219 |
|
global $wpdb; |
| 220 |
|
|
| 221 |
|
$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config ); |
| 222 |
|
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 223 |
|
$count = $wpdb->get_var( $query ); |
| 224 |
|
|
| 225 |
|
return (int) ceil( $count / self::ARRAY_CHUNK_SIZE ); |
| 226 |
|
} |
| 227 |
|
|
| 228 |
|
/** |