1 | <?php |
||
22 | class Spooler extends BaseObject |
||
23 | { |
||
24 | public static $tableName = 'ym_elastic_spool_item'; |
||
25 | |||
26 | /** |
||
27 | * @param $actionCode string ElasticSearch action code (INDEX, DELETE supported) |
||
28 | * @param $modelName string ActiveRecord class name |
||
29 | * @param $recordId int ActiveRecord record id |
||
30 | * @return \yii\db\Command |
||
31 | */ |
||
32 | public static function saveItem($actionCode, $modelName, $recordId) |
||
46 | |||
47 | /** |
||
48 | * |
||
49 | * @param $modelName string |
||
50 | * @param $modelTable string |
||
51 | * @throws Exception |
||
52 | * @throws \Exception |
||
53 | * @return \yii\db\Command |
||
54 | */ |
||
55 | public static function reindexData($modelName, $modelTable) |
||
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | * @throws \yii\db\Exception |
||
86 | */ |
||
87 | public static function deleteProcessingRows() |
||
97 | |||
98 | /** |
||
99 | * Marks a batch to is_processing |
||
100 | * |
||
101 | * @param integer $limit |
||
102 | * @param integer $offset |
||
103 | * @param string $class |
||
104 | * @return int |
||
105 | */ |
||
106 | public static function setProcessingRows($limit, $offset, $class) |
||
120 | |||
121 | /** |
||
122 | * Provides total count |
||
123 | * |
||
124 | * @param $className |
||
125 | * @return int |
||
126 | */ |
||
127 | public static function getTotalCount($className) |
||
135 | |||
136 | /** |
||
137 | * Sets all rows to is_processing to 0 |
||
138 | * @return int |
||
139 | * @throws Exception |
||
140 | */ |
||
141 | public static function removeProcessingRows() |
||
148 | } |
||
149 |