Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92762812
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, Nov 23, 12:41
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 12:41 (2 d)
Engine
blob
Format
Raw Data
Handle
22484588
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