@@ -7,45 +7,45 @@ |
||
| 7 | 7 | |
| 8 | 8 | class Sync_Background_Process_Users_Stage { |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * @var Sync_Object_Adapter_Factory |
|
| 12 | - */ |
|
| 13 | - private $sync_object_adapter_factory; |
|
| 10 | + /** |
|
| 11 | + * @var Sync_Object_Adapter_Factory |
|
| 12 | + */ |
|
| 13 | + private $sync_object_adapter_factory; |
|
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Sync_Background_Process_Posts_Stage constructor. |
|
| 17 | - * |
|
| 18 | - * @param Sync_Object_Adapter_Factory $sync_object_adapter_factory |
|
| 19 | - */ |
|
| 20 | - function __construct( $sync_object_adapter_factory ) { |
|
| 21 | - $this->sync_object_adapter_factory = $sync_object_adapter_factory; |
|
| 22 | - } |
|
| 15 | + /** |
|
| 16 | + * Sync_Background_Process_Posts_Stage constructor. |
|
| 17 | + * |
|
| 18 | + * @param Sync_Object_Adapter_Factory $sync_object_adapter_factory |
|
| 19 | + */ |
|
| 20 | + function __construct( $sync_object_adapter_factory ) { |
|
| 21 | + $this->sync_object_adapter_factory = $sync_object_adapter_factory; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - function count() { |
|
| 24 | + function count() { |
|
| 25 | 25 | |
| 26 | - global $wpdb; |
|
| 26 | + global $wpdb; |
|
| 27 | 27 | |
| 28 | - $sql = " |
|
| 28 | + $sql = " |
|
| 29 | 29 | SELECT COUNT( DISTINCT post_author ) |
| 30 | 30 | FROM $wpdb->posts |
| 31 | 31 | "; |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - return $wpdb->get_var( $sql ); |
|
| 35 | - } |
|
| 34 | + return $wpdb->get_var( $sql ); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - function get_sync_object_adapters( $offset, $limit ) { |
|
| 37 | + function get_sync_object_adapters( $offset, $limit ) { |
|
| 38 | 38 | |
| 39 | - global $wpdb; |
|
| 40 | - $sql = " |
|
| 39 | + global $wpdb; |
|
| 40 | + $sql = " |
|
| 41 | 41 | SELECT DISTINCT post_author |
| 42 | 42 | FROM $wpdb->posts |
| 43 | 43 | LIMIT %d, %d |
| 44 | 44 | "; |
| 45 | 45 | |
| 46 | - $ids = $wpdb->get_col( $wpdb->prepare( $sql, $offset, $limit ) ); |
|
| 46 | + $ids = $wpdb->get_col( $wpdb->prepare( $sql, $offset, $limit ) ); |
|
| 47 | 47 | |
| 48 | - return $this->sync_object_adapter_factory->create_many( Object_Type_Enum::USER, $ids ); |
|
| 49 | - } |
|
| 48 | + return $this->sync_object_adapter_factory->create_many( Object_Type_Enum::USER, $ids ); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @param Sync_Object_Adapter_Factory $sync_object_adapter_factory |
| 19 | 19 | */ |
| 20 | - function __construct( $sync_object_adapter_factory ) { |
|
| 20 | + function __construct($sync_object_adapter_factory) { |
|
| 21 | 21 | $this->sync_object_adapter_factory = $sync_object_adapter_factory; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | "; |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - return $wpdb->get_var( $sql ); |
|
| 34 | + return $wpdb->get_var($sql); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - function get_sync_object_adapters( $offset, $limit ) { |
|
| 37 | + function get_sync_object_adapters($offset, $limit) { |
|
| 38 | 38 | |
| 39 | 39 | global $wpdb; |
| 40 | 40 | $sql = " |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | LIMIT %d, %d |
| 44 | 44 | "; |
| 45 | 45 | |
| 46 | - $ids = $wpdb->get_col( $wpdb->prepare( $sql, $offset, $limit ) ); |
|
| 46 | + $ids = $wpdb->get_col($wpdb->prepare($sql, $offset, $limit)); |
|
| 47 | 47 | |
| 48 | - return $this->sync_object_adapter_factory->create_many( Object_Type_Enum::USER, $ids ); |
|
| 48 | + return $this->sync_object_adapter_factory->create_many(Object_Type_Enum::USER, $ids); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | } |