@@ -9,6 +9,9 @@ discard block |
||
9 | 9 | public $id; |
10 | 10 | public $items_with_ids; |
11 | 11 | |
12 | + /** |
|
13 | + * @param string $id |
|
14 | + */ |
|
12 | 15 | public function __construct( $id, $items_with_ids ) { |
13 | 16 | $this->id = $id; |
14 | 17 | $this->items_with_ids = $items_with_ids; |
@@ -31,6 +34,10 @@ discard block |
||
31 | 34 | const QUEUE_LOCK_TIMEOUT = 300; // 5 minutes |
32 | 35 | public function acquire_lock( $wait = 0 ); |
33 | 36 | public function release_lock(); |
37 | + |
|
38 | + /** |
|
39 | + * @return void |
|
40 | + */ |
|
34 | 41 | public function reset(); |
35 | 42 | } |
36 | 43 | |
@@ -127,6 +134,9 @@ discard block |
||
127 | 134 | return true; |
128 | 135 | } |
129 | 136 | |
137 | + /** |
|
138 | + * @param string $buffer_id |
|
139 | + */ |
|
130 | 140 | public function release_lock( $buffer_id ) { |
131 | 141 | global $wpdb; |
132 | 142 | $result = $wpdb->get_var( $wpdb->prepare( "SELECT RELEASE_LOCK( %s )", $this->named_lock_name ) ); |
@@ -156,6 +166,9 @@ discard block |
||
156 | 166 | private $row_iterator; |
157 | 167 | private $lock; |
158 | 168 | |
169 | + /** |
|
170 | + * @param string $id |
|
171 | + */ |
|
159 | 172 | function __construct( $id ) { |
160 | 173 | $this->id = str_replace( '-', '_', $id ); // necessary to ensure we don't have ID collisions in the SQL |
161 | 174 | $this->row_iterator = 0; |