Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93259297
PhabricatorSearchNgramsDestructionEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 27, 10:22
Size
708 B
Mime Type
text/x-php
Expires
Fri, Nov 29, 10:22 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22605102
Attached To
rPH Phabricator
PhabricatorSearchNgramsDestructionEngineExtension.php
View Options
<?php
final
class
PhabricatorSearchNgramsDestructionEngineExtension
extends
PhabricatorDestructionEngineExtension
{
const
EXTENSIONKEY
=
'search.ngrams'
;
public
function
getExtensionName
()
{
return
pht
(
'Search Ngram'
);
}
public
function
canDestroyObject
(
PhabricatorDestructionEngine
$engine
,
$object
)
{
return
(
$object
instanceof
PhabricatorNgramsInterface
);
}
public
function
destroyObject
(
PhabricatorDestructionEngine
$engine
,
$object
)
{
foreach
(
$object
->
newNgrams
()
as
$ngram
)
{
queryfx
(
$ngram
->
establishConnection
(
'w'
),
'DELETE FROM %T WHERE objectID = %d'
,
$ngram
->
getTableName
(),
$object
->
getID
());
}
}
}
Event Timeline
Log In to Comment