Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98289693
PhabricatorCalendarImportFrequencyTransaction.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
Sat, Jan 11, 19:47
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 13, 19:47 (2 d)
Engine
blob
Format
Raw Data
Handle
23550635
Attached To
rPH Phabricator
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 frequences are: %s.'
,
$value
,
implode
(
', '
,
$valid
)),
$xaction
);
}
}
return
$errors
;
}
}
Event Timeline
Log In to Comment