class-mysqldumpwriter.php
6 days ago
class-staticpostfileswriter.php
6 days ago
class-wxrwriter.php
6 days ago
interface-entity-writer.php
6 days ago
interface-entity-writer.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WordPress\DataLiberation\EntityWriter; |
| 4 | |
| 5 | use WordPress\DataLiberation\ImportEntity; |
| 6 | |
| 7 | /** |
| 8 | * The Entity Writer sends content to a destination. |
| 9 | */ |
| 10 | interface EntityWriter { |
| 11 | |
| 12 | /** |
| 13 | * Writes an entity to the destination. |
| 14 | * |
| 15 | * @param ImportEntity $entity The entity to write. |
| 16 | */ |
| 17 | public function append_entity( ImportEntity $entity ); |
| 18 | |
| 19 | /** |
| 20 | * Returns a cursor position that can be used to resume processing later. |
| 21 | * |
| 22 | * This allows for processing large imports in chunks without losing your place. |
| 23 | * Not all readers support this yet. |
| 24 | * |
| 25 | * @TODO: Define a general interface for entity readers. |
| 26 | * @return string Position marker for resuming later |
| 27 | */ |
| 28 | public function close_writing(); |
| 29 | |
| 30 | /** |
| 31 | * Returns a cursor position that can be used to resume writing later. |
| 32 | * |
| 33 | * This allows for processing large imports in chunks without losing the context, |
| 34 | * e.g. when writing to a WXR file it's important to know which tags are open. |
| 35 | * |
| 36 | * @return string Position marker for resuming later |
| 37 | */ |
| 38 | public function get_reentrancy_cursor(); |
| 39 | } |
| 40 |