Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93632353
AlmanacAddress.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 30, 07:29
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 07:29 (2 d)
Engine
blob
Format
Raw Data
Handle
22678045
Attached To
rPH Phabricator
AlmanacAddress.php
View Options
<?php
final
class
AlmanacAddress
extends
Phobject
{
private
$networkPHID
;
private
$address
;
private
$port
;
private
function
__construct
()
{
// <private>
}
public
function
getNetworkPHID
()
{
return
$this
->
networkPHID
;
}
public
function
getAddress
()
{
return
$this
->
address
;
}
public
function
getPort
()
{
return
$this
->
port
;
}
public
static
function
newFromDictionary
(
array
$dictionary
)
{
return
self
::
newFromParts
(
$dictionary
[
'networkPHID'
],
$dictionary
[
'address'
],
$dictionary
[
'port'
]);
}
public
static
function
newFromParts
(
$network_phid
,
$address
,
$port
)
{
$addr
=
new
AlmanacAddress
();
$addr
->
networkPHID
=
$network_phid
;
$addr
->
address
=
$address
;
$addr
->
port
=
(
int
)
$port
;
return
$addr
;
}
public
function
toDictionary
()
{
return
array
(
'networkPHID'
=>
$this
->
getNetworkPHID
(),
'address'
=>
$this
->
getAddress
(),
'port'
=>
$this
->
getPort
(),
);
}
public
function
toHash
()
{
return
PhabricatorHash
::
digestForIndex
(
json_encode
(
$this
->
toDictionary
()));
}
}
Event Timeline
Log In to Comment