Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F459999
AlmanacSearchEngineAttachment.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
),
'disabled'
=>
(
bool
)
$binding
->
getIsDisabled
(),
);
}
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
),
'status'
=>
$device
->
getStatus
(),
'disabled'
=>
$device
->
isDisabled
(),
);
}
protected
function
getAlmanacNetworkDictionary
(
AlmanacNetwork
$network
)
{
return
array
(
'id'
=>
(
int
)
$network
->
getID
(),
'phid'
=>
$network
->
getPHID
(),
'name'
=>
$network
->
getName
(),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 3:02 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72002
Default Alt Text
AlmanacSearchEngineAttachment.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment