| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function reparse($current = 0) |
||
| 41 | { |
||
| 42 | $reparser = new \skouat\ppde\textreparser\plugins\donation_pages_text( |
||
| 43 | $this->db, |
||
| 44 | $this->container->getParameter('core.table_prefix') . 'ppde_donation_pages' |
||
| 45 | ); |
||
| 46 | |||
| 47 | if (empty($current)) |
||
| 48 | { |
||
| 49 | $current = $reparser->get_max_id(); |
||
| 50 | } |
||
| 51 | |||
| 52 | $limit = 50; // Lets keep the reparsing conservative |
||
| 53 | $start = max(1, $current + 1 - $limit); |
||
| 54 | $end = max(1, $current); |
||
| 55 | |||
| 56 | $reparser->reparse_range($start, $end); |
||
| 57 | |||
| 58 | $current = $start - 1; |
||
| 59 | |||
| 60 | return ($current === 0) ? true : $current; |
||
| 61 | } |
||
| 63 |