| 1 | <?php |
||
| 17 | abstract class AbstractDataProvider extends BaseObject |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Languages |
||
| 21 | * @var array |
||
| 22 | */ |
||
| 23 | public $languages = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string[][] Elastic index mapping |
||
| 27 | */ |
||
| 28 | private $mapping = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Provides data to spool into elastic |
||
| 32 | * |
||
| 33 | * @return array |
||
| 34 | */ |
||
| 35 | abstract function getData(); |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Gives ES type name where the data should be inserted to |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | abstract function getTypeName(); |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Gives ES index name where the data should be inserted to |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | abstract function getIndexName(); |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Returns ActiveRecord class name |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | abstract function getRecordClassName(); |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Returns ActiveRecord table name |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | abstract function getRecordClassTableName(); |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function getMapping() |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Callback to be used to init dependant data |
||
| 81 | * @return mixed |
||
| 82 | */ |
||
| 83 | abstract public function initializeDependentData(); |
||
| 84 | } |
||
| 85 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.