IndexStrategy.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\search\impl;
12 
14 
15 /**
16  * IndexStrategy defines the interface for indexing implementations.
17  */
18 interface IndexStrategy {
19 
20  /**
21  * Get the lucene document for a PersistentObject
22  * @param $obj PersistenceObject instance
23  * @param $language The language
24  * @return Document or null, if object should not be contained in the index
25  */
26  public function getDocument(PersistentObject $obj, $language);
27 
28  /**
29  * Encode the given value according to the input type
30  * @param $value
31  * @param $inputType
32  * @return String
33  */
34  public function encodeValue($value, $inputType);
35 }
36 ?>
getDocument(PersistentObject $obj, $language)
Get the lucene document for a PersistentObject.
encodeValue($value, $inputType)
Encode the given value according to the input type.
IndexStrategy defines the interface for indexing implementations.
PersistentObject defines the interface of all persistent objects.