Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93222650
AlmanacSearchEngineAttachment.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, 03:37
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Nov 29, 03:37 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22582597
Attached To
rPH Phabricator
AlmanacSearchEngineAttachment.php
View Options
<?php
abstract
class
AlmanacSearchEngineAttachment
extends
PhabricatorSearchEngineAttachment
{
protected
function
getAlmanacPropertyList
(
$object
)
{
$builtins
=
$object
->
getAlmanacPropertyFieldSpecifications
();
$properties
=
array
();
foreach
(
$object
->
getAlmanacProperties
()
as
$key
=>
$property
)
{
$is_builtin
=
isset
(
$builtins
[
$key
]);
$properties
[]
=
array
(
'key'
=>
$key
,
'value'
=>
$property
->
getFieldValue
(),
'builtin'
=>
$is_builtin
,
);
}
return
$properties
;
}
protected
function
getAlmanacBindingDictionary
(
AlmanacBinding
$binding
)
{
$interface
=
$binding
->
getInterface
();
return
array
(
'id'
=>
(
int
)
$binding
->
getID
(),
'phid'
=>
$binding
->
getPHID
(),
'properties'
=>
$this
->
getAlmanacPropertyList
(
$binding
),
'interface'
=>
$this
->
getAlmanacInterfaceDictionary
(
$interface
),
);
}
protected
function
getAlmanacInterfaceDictionary
(
AlmanacInterface
$interface
)
{
return
array
(
'id'
=>
(
int
)
$interface
->
getID
(),
'phid'
=>
$interface
->
getPHID
(),
'address'
=>
$interface
->
getAddress
(),
'port'
=>
(
int
)
$interface
->
getPort
(),
'device'
=>
$this
->
getAlmanacDeviceDictionary
(
$interface
->
getDevice
()),
'network'
=>
$this
->
getAlmanacNetworkDictionary
(
$interface
->
getNetwork
()),
);
}
protected
function
getAlmanacDeviceDictionary
(
AlmanacDevice
$device
)
{
return
array
(
'id'
=>
(
int
)
$device
->
getID
(),
'phid'
=>
$device
->
getPHID
(),
'name'
=>
$device
->
getName
(),
'properties'
=>
$this
->
getAlmanacPropertyList
(
$device
),
);
}
protected
function
getAlmanacNetworkDictionary
(
AlmanacNetwork
$network
)
{
return
array
(
'id'
=>
(
int
)
$network
->
getID
(),
'phid'
=>
$network
->
getPHID
(),
'name'
=>
$network
->
getName
(),
);
}
}
Event Timeline
Log In to Comment