|
@@ 197-206 (lines=10) @@
|
| 194 |
|
/** |
| 195 |
|
* Delete words not related to any content object. |
| 196 |
|
*/ |
| 197 |
|
public function deleteWordsWithoutObjects() |
| 198 |
|
{ |
| 199 |
|
$query = $this->dbHandler->createDeleteQuery(); |
| 200 |
|
|
| 201 |
|
$query->deleteFrom($this->dbHandler->quoteTable('ezsearch_word')) |
| 202 |
|
->where($query->expr->eq($this->dbHandler->quoteColumn('object_count'), ':c')); |
| 203 |
|
|
| 204 |
|
$stmt = $query->prepare(); |
| 205 |
|
$stmt->execute(['c' => 0]); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
/** |
| 209 |
|
* Delete relation between a word and a content object. |
|
@@ 213-221 (lines=9) @@
|
| 210 |
|
* |
| 211 |
|
* @param $contentId |
| 212 |
|
*/ |
| 213 |
|
public function deleteObjectWordsLink($contentId) |
| 214 |
|
{ |
| 215 |
|
$query = $this->dbHandler->createDeleteQuery(); |
| 216 |
|
$query->deleteFrom($this->dbHandler->quoteTable('ezsearch_object_word_link')) |
| 217 |
|
->where($query->expr->eq($this->dbHandler->quoteColumn('contentobject_id'), ':contentId')); |
| 218 |
|
|
| 219 |
|
$stmt = $query->prepare(); |
| 220 |
|
$stmt->execute(['contentId' => $contentId]); |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
/** |
| 224 |
|
* Set query selecting word ids for content object (method was extracted to be reusable). |