| 1 | <?php |
||
| 12 | abstract class DumpReader implements IteratorAggregate { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Returns a string with the json of the next entity, |
||
| 16 | * or null if there are no further entities. |
||
| 17 | * |
||
| 18 | * @return Page|null |
||
| 19 | * @throws DumpReaderException |
||
| 20 | */ |
||
| 21 | public abstract function nextEntityPage(); |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Rewinds the reader to the beginning of the dump. |
||
| 25 | */ |
||
| 26 | public abstract function rewind(); |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Seeks to the Page with the provided title and returns it. |
||
| 30 | * If no page is found, null is returned. |
||
| 31 | * |
||
| 32 | * @param string $titleToSeekTo |
||
| 33 | * |
||
| 34 | * @return Page|null |
||
| 35 | */ |
||
| 36 | public function seekToTitle( $titleToSeekTo ) { |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Returns an Iterator for the REMAINING pages. |
||
| 48 | * Caution: the iterator affects the position of the dump reader itself. |
||
| 49 | * |
||
| 50 | * @see IteratorAggregate::getIterator |
||
| 51 | * @return Iterator |
||
| 52 | */ |
||
| 53 | public function getIterator() { |
||
| 56 | |||
| 57 | } |
||
| 58 |