Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96616959
AlmanacCacheEngineExtension.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
Sat, Dec 28, 23:52
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 30, 23:52 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23216502
Attached To
rPH Phabricator
AlmanacCacheEngineExtension.php
View Options
<?php
final
class
AlmanacCacheEngineExtension
extends
PhabricatorCacheEngineExtension
{
const
EXTENSIONKEY
=
'almanac'
;
public
function
getExtensionName
()
{
return
pht
(
'Almanac Core Objects'
);
}
public
function
discoverLinkedObjects
(
PhabricatorCacheEngine
$engine
,
array
$objects
)
{
$viewer
=
$engine
->
getViewer
();
$results
=
array
();
foreach
(
$this
->
selectObjects
(
$objects
,
'AlmanacBinding'
)
as
$object
)
{
$results
[]
=
$object
->
getServicePHID
();
$results
[]
=
$object
->
getDevicePHID
();
$results
[]
=
$object
->
getInterfacePHID
();
}
$devices
=
$this
->
selectObjects
(
$objects
,
'AlmanacDevice'
);
if
(
$devices
)
{
$interfaces
=
id
(
new
AlmanacInterfaceQuery
())
->
setViewer
(
$viewer
)
->
withDevicePHIDs
(
mpull
(
$devices
,
'getPHID'
))
->
execute
();
foreach
(
$interfaces
as
$interface
)
{
$results
[]
=
$interface
;
}
}
foreach
(
$this
->
selectObjects
(
$objects
,
'AlmanacInterface'
)
as
$iface
)
{
$results
[]
=
$iface
->
getDevicePHID
();
$results
[]
=
$iface
->
getNetworkPHID
();
}
foreach
(
$this
->
selectObjects
(
$objects
,
'AlmanacProperty'
)
as
$object
)
{
$results
[]
=
$object
->
getObjectPHID
();
}
return
$results
;
}
public
function
deleteCaches
(
PhabricatorCacheEngine
$engine
,
array
$objects
)
{
return
;
}
}
Event Timeline
Log In to Comment