Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92320469
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
Tue, Nov 19, 09:33
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 21, 09:33 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22422770
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