Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99933797
PhabricatorCalendarEventRecurringTransaction.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
Mon, Jan 27, 08:38
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Jan 29, 08:38 (2 d)
Engine
blob
Format
Raw Data
Handle
23852745
Attached To
rPH Phabricator
PhabricatorCalendarEventRecurringTransaction.php
View Options
<?php
final
class
PhabricatorCalendarEventRecurringTransaction
extends
PhabricatorCalendarEventTransactionType
{
const
TRANSACTIONTYPE
=
'calendar.recurring'
;
public
function
generateOldValue
(
$object
)
{
return
(
int
)
$object
->
getIsRecurring
();
}
public
function
generateNewValue
(
$object
,
$value
)
{
return
(
int
)
$value
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setIsRecurring
(
$value
);
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
$old
=
$object
->
getIsRecurring
();
foreach
(
$xactions
as
$xaction
)
{
if
(
$this
->
isNewObject
())
{
continue
;
}
if
(
$xaction
->
getNewValue
()
==
$old
)
{
continue
;
}
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'An event can only be made recurring when it is created. '
.
'You can not convert an existing event into a recurring '
.
'event or vice versa.'
),
$xaction
);
}
return
$errors
;
}
}
Event Timeline
Log In to Comment