Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F449457
PhabricatorCalendarEventHostTransaction.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
PhabricatorCalendarEventHostTransaction.php
View Options
<?php
final
class
PhabricatorCalendarEventHostTransaction
extends
PhabricatorCalendarEventTransactionType
{
const
TRANSACTIONTYPE
=
'calendar.host'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getHostPHID
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setHostPHID
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed the host of this event from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldHandle
(),
$this
->
renderNewHandle
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s changed the host of %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldHandle
(),
$this
->
renderNewHandle
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
foreach
(
$xactions
as
$xaction
)
{
$host_phid
=
$xaction
->
getNewValue
();
if
(!
$host_phid
)
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Event host is required.'
));
continue
;
}
$user
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$this
->
getActor
())
->
withPHIDs
(
array
(
$host_phid
))
->
executeOne
();
if
(!
$user
)
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Host PHID "%s" is not a valid user PHID.'
,
$host_phid
));
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 7:24 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
67482
Default Alt Text
PhabricatorCalendarEventHostTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment