1 | <?php |
||
7 | abstract class Jetpack_Sync_Module { |
||
8 | const ARRAY_CHUNK_SIZE = 10; |
||
9 | |||
10 | abstract public function name(); |
||
11 | |||
12 | // override these to set up listeners and set/reset data/defaults |
||
13 | public function init_listeners( $callable ) {} |
||
14 | public function init_before_send() {} |
||
15 | public function set_defaults() {} |
||
16 | public function reset_data() {} |
||
17 | public function enqueue_full_sync_actions() { |
||
21 | |||
22 | public function get_full_sync_actions() { |
||
25 | |||
26 | protected function count_actions( $action_names, $actions_to_count ) { |
||
29 | |||
30 | protected function get_check_sum( $values ) { |
||
31 | return crc32( json_encode( $values ) ); |
||
32 | } |
||
33 | |||
34 | protected function still_valid_checksum( $sums_to_check, $name, $new_sum ) { |
||
35 | if ( isset( $sums_to_check[ $name ] ) && $sums_to_check[ $name ] === $new_sum ) { |
||
36 | return true; |
||
37 | } |
||
38 | return false; |
||
39 | } |
||
40 | |||
41 | protected function enqueue_all_ids_as_action( $action_name, $table_name, $id_field, $where_sql ) { |
||
73 | |||
74 | protected function get_metadata( $ids, $meta_type ) { |
||
84 | |||
85 | protected function get_term_relationships( $ids ) { |
||
90 | } |
||
91 |