Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96623267
PhabricatorCalendarEventHostTransaction.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
Sun, Dec 29, 02:55
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 31, 02:55 (2 d)
Engine
blob
Format
Raw Data
Handle
23217670
Attached To
rPH Phabricator
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
;
}
}
Event Timeline
Log In to Comment