public getContentObjectWords ( $contentId ) : array | ||
$contentId | ||
Résultat | array |
public function getContentObjectWords($contentId)
{
$query = $this->dbHandler->createSelectQuery();
$this->setContentObjectWordsSelectQuery($query);
$stmt = $query->prepare();
$stmt->execute(['contentId' => $contentId]);
$wordIDList = [];
while (false !== ($row = $stmt->fetch(PDO::FETCH_NUM))) {
$wordIDList[] = $row[0];
}
return $wordIDList;
}
/** * Remove whole content or a specific version from index. * * Ported from the legacy code * @see https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/search/plugins/ezsearchengine/ezsearchengine.php#L386 * * @param mixed $contentId * @param mixed|null $versionId * * @return bool */ public function remove($contentId, $versionId = null) { $doDelete = false; $this->dbHandler->beginTransaction(); // fetch all the words and decrease the object count on all the words $wordIDList = $this->searchIndex->getContentObjectWords($contentId); if (count($wordIDList) > 0) { $this->searchIndex->decrementWordObjectCount($wordIDList); $doDelete = true; } if ($doDelete) { $this->searchIndex->deleteWordsWithoutObjects(); $this->searchIndex->deleteObjectWordsLink($contentId); } $this->dbHandler->commit(); return true; }