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