Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894648
PhabricatorCalendarEventAllDayTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorCalendarEventAllDayTransaction.php
View Options
<?php
final
class
PhabricatorCalendarEventAllDayTransaction
extends
PhabricatorCalendarEventTransactionType
{
const
TRANSACTIONTYPE
=
'calendar.allday'
;
public
function
generateOldValue
(
$object
)
{
return
(int)
$object
->
getIsAllDay
(
)
;
}
public
function
generateNewValue
(
$object
,
$value
)
{
return
(int)
$value
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setIsAllDay
(
$value
)
;
// Adjust the flags on any other dates the event has.
$keys
=
array
(
'startDateTime'
,
'endDateTime'
,
'untilDateTime'
,
)
;
foreach
(
$keys
as
$key
)
{
$dict
=
$object
->
getParameter
(
$key
)
;
if
(
!
$dict
)
{
continue
;
}
$datetime
=
PhutilCalendarAbsoluteDateTime
::
newFromDictionary
(
$dict
)
;
$datetime
->
setIsAllDay
(
$value
)
;
$object
->
setParameter
(
$key
,
$datetime
->
toDictionary
(
)
)
;
}
}
public
function
getTitle
(
)
{
if
(
$this
->
getNewValue
(
)
)
{
return
pht
(
'%s changed this to an all day event.'
,
$this
->
renderAuthor
(
)
)
;
}
else
{
return
pht
(
'%s converted this from an all day event.'
,
$this
->
renderAuthor
(
)
)
;
}
}
public
function
getTitleForFeed
(
)
{
if
(
$this
->
getNewValue
(
)
)
{
return
pht
(
'%s changed %s to an all day event.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderObject
(
)
)
;
}
else
{
return
pht
(
'%s converted %s from an all day event.'
,
$this
->
renderAuthor
(
)
,
$this
->
renderObject
(
)
)
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 20:11 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1111898
Default Alt Text
PhabricatorCalendarEventAllDayTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment