Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82319969
NuanceSourceDefaultQueueTransaction.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
Tue, Sep 10, 18:19
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Sep 12, 18:19 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20680147
Attached To
rPH Phabricator
NuanceSourceDefaultQueueTransaction.php
View Options
<?php
final
class
NuanceSourceDefaultQueueTransaction
extends
NuanceSourceTransactionType
{
const
TRANSACTIONTYPE
=
'source.queue.default'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getDefaultQueuePHID
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setDefaultQueuePHID
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed the default queue for this source from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldHandle
(),
$this
->
renderNewHandle
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(!
$object
->
getDefaultQueuePHID
()
&&
!
$xactions
)
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Sources must have a default queue.'
));
}
foreach
(
$xactions
as
$xaction
)
{
if
(!
$xaction
->
getNewValue
())
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Sources must have a default queue.'
));
}
}
return
$errors
;
}
}
Event Timeline
Log In to Comment