Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F552212
PhabricatorCalendarImportFrequencyTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorCalendarImportFrequencyTransaction.php
View Options
<?php
final
class
PhabricatorCalendarImportFrequencyTransaction
extends
PhabricatorCalendarImportTransactionType
{
const
TRANSACTIONTYPE
=
'calendar.import.frequency'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getTriggerFrequency
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setTriggerFrequency
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s changed the automatic update frequency for this import.'
,
$this
->
renderAuthor
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
$frequency_map
=
PhabricatorCalendarImport
::
getTriggerFrequencyMap
();
$valid
=
array_keys
(
$frequency_map
);
$valid
=
array_fuse
(
$valid
);
foreach
(
$xactions
as
$xaction
)
{
$value
=
$xaction
->
getNewValue
();
if
(!
isset
(
$valid
[
$value
]))
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Import frequency "%s" is not valid. Valid frequencies are: %s.'
,
$value
,
implode
(
', '
,
$valid
)),
$xaction
);
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 4:12 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
100992
Default Alt Text
PhabricatorCalendarImportFrequencyTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment