Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Import\Postprocessor; |
| 4 | |
| 5 | use Flow\Import\IImportHeader; |
| 6 | use Flow\Import\IImportPost; |
| 7 | use Flow\Import\IImportTopic; |
| 8 | use Flow\Import\PageImportState; |
| 9 | use Flow\Import\TopicImportState; |
| 10 | use Flow\Model\PostRevision; |
| 11 | |
| 12 | /** |
| 13 | * We might want to implement a no-op AbstractPostprocessor, so you can extend that and implement |
| 14 | * what you want, without "not a thing to do yet". |
| 15 | */ |
| 16 | interface Postprocessor { |
| 17 | /** |
| 18 | * Called after the successful commit of a header. This is |
| 19 | * currently called regardless of if any new content was imported. |
| 20 | * |
| 21 | * @param PageImportState $state |
| 22 | * @param IImportHeader $header |
| 23 | */ |
| 24 | public function afterHeaderImported( PageImportState $state, IImportHeader $header ); |
| 25 | |
| 26 | /** |
| 27 | * Called after the import of a single post. This has not yet been |
| 28 | * commited, and serves to inform the postprocessor about topic |
| 29 | * import progress. Only posts that have not been previously |
| 30 | * imported are reported here. |
| 31 | * |
| 32 | * @param TopicImportState $state |
| 33 | * @param IImportPost $post |
| 34 | * @param PostRevision $newPost |
| 35 | */ |
| 36 | public function afterPostImported( TopicImportState $state, IImportPost $post, PostRevision $newPost ); |
| 37 | |
| 38 | /** |
| 39 | * Called after the successful commit of a topic to the database. |
| 40 | * This may or may not have imported any actual posts, it is |
| 41 | * called on all topics run through the process regardless. |
| 42 | * |
| 43 | * @param TopicImportState $state |
| 44 | * @param IImportTopic $topic |
| 45 | */ |
| 46 | public function afterTopicImported( TopicImportState $state, IImportTopic $topic ); |
| 47 | |
| 48 | /** |
| 49 | * Called when there has been an error in the import process. |
| 50 | * Any information the postprocessor has received since the last |
| 51 | * commit operation should be discarded as it will not be written |
| 52 | * to permenant storage. |
| 53 | */ |
| 54 | public function importAborted(); |
| 55 | } |