Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / search / engineextension / PhabricatorSearchNgramsDestructionEngineExtension.php
blobeb80e014e3bc4e586926a9e523b71c906e2fd5fe
1 <?php
3 final class PhabricatorSearchNgramsDestructionEngineExtension
4 extends PhabricatorDestructionEngineExtension {
6 const EXTENSIONKEY = 'search.ngrams';
8 public function getExtensionName() {
9 return pht('Search Ngram');
12 public function canDestroyObject(
13 PhabricatorDestructionEngine $engine,
14 $object) {
15 return ($object instanceof PhabricatorNgramsInterface);
18 public function destroyObject(
19 PhabricatorDestructionEngine $engine,
20 $object) {
22 foreach ($object->newNgrams() as $ngram) {
23 queryfx(
24 $ngram->establishConnection('w'),
25 'DELETE FROM %T WHERE objectID = %d',
26 $ngram->getTableName(),
27 $object->getID());