Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92697263
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
Fri, Nov 22, 21:20
Size
708 B
Mime Type
text/x-php
Expires
Sun, Nov 24, 21:20 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22489930
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