Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F470982
AlmanacInterfaceAddressTransaction.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
AlmanacInterfaceAddressTransaction.php
View Options
<?php
final
class
AlmanacInterfaceAddressTransaction
extends
AlmanacInterfaceTransactionType
{
const
TRANSACTIONTYPE
=
'almanac:interface:address'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getAddress
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setAddress
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed the address for this interface from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getAddress
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Interfaces must have an address.'
));
}
foreach
(
$xactions
as
$xaction
)
{
// NOTE: For now, we don't validate addresses. We generally expect users
// to provide IPv4 addresses, but it's reasonable for them to provide
// IPv6 addresses, and some installs currently use DNS names. This is
// off-label but works today.
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 12:50 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
82056
Default Alt Text
AlmanacInterfaceAddressTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment