| @@ 87-101 (lines=15) @@ | ||
| 84 | * @param int $phash |
|
| 85 | * @return int|bool |
|
| 86 | */ |
|
| 87 | public function getNumberOfFulltextRecords($phash) |
|
| 88 | { |
|
| 89 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('index_fulltext'); |
|
| 90 | return $queryBuilder |
|
| 91 | ->count('phash') |
|
| 92 | ->from('index_fulltext') |
|
| 93 | ->where( |
|
| 94 | $queryBuilder->expr()->eq( |
|
| 95 | 'phash', |
|
| 96 | $queryBuilder->createNamedParameter($phash, \PDO::PARAM_INT) |
|
| 97 | ) |
|
| 98 | ) |
|
| 99 | ->execute() |
|
| 100 | ->fetchColumn(0); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * Get number of words |
|
| @@ 109-123 (lines=15) @@ | ||
| 106 | * @param int $phash |
|
| 107 | * @return int|bool |
|
| 108 | */ |
|
| 109 | public function getNumberOfWords($phash) |
|
| 110 | { |
|
| 111 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('index_rel'); |
|
| 112 | return $queryBuilder |
|
| 113 | ->count('*') |
|
| 114 | ->from('index_rel') |
|
| 115 | ->where( |
|
| 116 | $queryBuilder->expr()->eq( |
|
| 117 | 'phash', |
|
| 118 | $queryBuilder->createNamedParameter($phash, \PDO::PARAM_INT) |
|
| 119 | ) |
|
| 120 | ) |
|
| 121 | ->execute() |
|
| 122 | ->fetchColumn(0); |
|
| 123 | } |
|
| 124 | ||
| 125 | /** |
|
| 126 | * Get statistic of external documents |
|
| @@ 30-44 (lines=15) @@ | ||
| 27 | * |
|
| 28 | * @return bool |
|
| 29 | */ |
|
| 30 | public function execute() |
|
| 31 | { |
|
| 32 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_preview'); |
|
| 33 | $queryBuilder |
|
| 34 | ->delete('sys_preview') |
|
| 35 | ->where( |
|
| 36 | $queryBuilder->expr()->lt( |
|
| 37 | 'endtime', |
|
| 38 | $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT) |
|
| 39 | ) |
|
| 40 | ) |
|
| 41 | ->execute(); |
|
| 42 | ||
| 43 | return true; |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| @@ 84-99 (lines=16) @@ | ||
| 81 | * @param int $uid Preset record |
|
| 82 | * @return array Preset record, if any (otherwise FALSE) |
|
| 83 | */ |
|
| 84 | public function getPreset($uid) |
|
| 85 | { |
|
| 86 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 87 | ->getQueryBuilderForTable('tx_impexp_presets'); |
|
| 88 | ||
| 89 | return $queryBuilder->select('*') |
|
| 90 | ->from('tx_impexp_presets') |
|
| 91 | ->where( |
|
| 92 | $queryBuilder->expr()->eq( |
|
| 93 | 'uid', |
|
| 94 | $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT) |
|
| 95 | ) |
|
| 96 | ) |
|
| 97 | ->execute() |
|
| 98 | ->fetch(); |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * Manipulate presets |
|
| @@ 304-317 (lines=14) @@ | ||
| 301 | /** |
|
| 302 | * Removes all expired treelist cache entries |
|
| 303 | */ |
|
| 304 | protected function removeExpiredCacheEntries() |
|
| 305 | { |
|
| 306 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 307 | ->getQueryBuilderForTable('cache_treelist'); |
|
| 308 | $queryBuilder |
|
| 309 | ->delete('cache_treelist') |
|
| 310 | ->where( |
|
| 311 | $queryBuilder->expr()->lte( |
|
| 312 | 'expires', |
|
| 313 | $queryBuilder->createNamedParameter($GLOBALS['EXEC_TIME'], \PDO::PARAM_INT) |
|
| 314 | ) |
|
| 315 | ) |
|
| 316 | ->execute(); |
|
| 317 | } |
|
| 318 | ||
| 319 | /** |
|
| 320 | * Determines what happened to the page record, this is necessary to clear |
|
| @@ 764-776 (lines=13) @@ | ||
| 761 | * |
|
| 762 | * @return bool |
|
| 763 | */ |
|
| 764 | protected function checkIfLanguagesExist() |
|
| 765 | { |
|
| 766 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 767 | ->getQueryBuilderForTable('sys_language'); |
|
| 768 | $queryBuilder->getRestrictions()->removeAll(); |
|
| 769 | ||
| 770 | $count = $queryBuilder |
|
| 771 | ->count('uid') |
|
| 772 | ->from('sys_language') |
|
| 773 | ->execute() |
|
| 774 | ->fetchColumn(0); |
|
| 775 | return (bool)$count; |
|
| 776 | } |
|
| 777 | ||
| 778 | /** |
|
| 779 | * Return language service instance |
|