Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98342293
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
Sun, Jan 12, 07:01
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 14, 07:01 (2 d)
Engine
blob
Format
Raw Data
Handle
23565080
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
isInheritedEdit
()
{
return
false
;
}
public
function
shouldHide
()
{
// This event isn't interesting on its own, and is accompanied by an
// "alice set this event to repeat weekly." event in normal circumstances
// anyway.
return
true
;
}
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
;
}
if
(
$xaction
->
getNewValue
())
{
continue
;
}
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'An event can not be stopped from recurring once it has been '
.
'made recurring. You can cancel the event.'
),
$xaction
);
}
return
$errors
;
}
}
Event Timeline
Log In to Comment