1 | <?php |
||
24 | abstract class Indexer |
||
25 | { |
||
26 | const CONTENTOBJECT_TABLE = 'ezcontentobject'; |
||
27 | const CONTENTOBJECT_TREE_TABLE = 'ezcontentobject_tree'; |
||
28 | |||
29 | /** |
||
30 | * @var \Psr\Log\LoggerInterface |
||
31 | */ |
||
32 | protected $logger; |
||
33 | |||
34 | /** |
||
35 | * @var \eZ\Publish\SPI\Persistence\Handler |
||
36 | */ |
||
37 | protected $persistenceHandler; |
||
38 | |||
39 | /** |
||
40 | * @var \eZ\Publish\Core\Persistence\Database\DatabaseHandler |
||
41 | */ |
||
42 | protected $databaseHandler; |
||
43 | |||
44 | /** |
||
45 | * @var \eZ\Publish\SPI\Search\Handler |
||
46 | */ |
||
47 | protected $searchHandler; |
||
48 | |||
49 | public function __construct( |
||
60 | |||
61 | /** |
||
62 | * Create search engine index. |
||
63 | * |
||
64 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
65 | * @param int $iterationCount |
||
66 | * @param bool $commit commit changes after each iteration |
||
67 | */ |
||
68 | abstract public function createSearchIndex(OutputInterface $output, $iterationCount, $commit); |
||
69 | |||
70 | /** |
||
71 | * Get PDOStatement to fetch metadata about content objects to be indexed. |
||
72 | * |
||
73 | * @param array $fields Select fields |
||
74 | * @return \PDOStatement |
||
75 | */ |
||
76 | protected function getContentDbFieldsStmt(array $fields) |
||
87 | |||
88 | /** |
||
89 | * Fetch location Ids for the given content object. |
||
90 | * |
||
91 | * @param int $contentObjectId |
||
92 | * @return array Location nodes Ids |
||
93 | */ |
||
94 | protected function getContentLocationIds($contentObjectId) |
||
106 | |||
107 | /** |
||
108 | * Log warning while progress bar is shown. |
||
109 | * |
||
110 | * @param \Symfony\Component\Console\Helper\ProgressBar $progress |
||
111 | * @param $message |
||
112 | */ |
||
113 | protected function logWarning(ProgressBar $progress, $message) |
||
119 | } |
||
120 |