3 final class PhabricatorCalendarImportFrequencyTransaction
4 extends PhabricatorCalendarImportTransactionType
{
6 const TRANSACTIONTYPE
= 'calendar.import.frequency';
8 public function generateOldValue($object) {
9 return $object->getTriggerFrequency();
12 public function applyInternalEffects($object, $value) {
13 $object->setTriggerFrequency($value);
16 public function getTitle() {
18 '%s changed the automatic update frequency for this import.',
19 $this->renderAuthor());
22 public function validateTransactions($object, array $xactions) {
25 $frequency_map = PhabricatorCalendarImport
::getTriggerFrequencyMap();
26 $valid = array_keys($frequency_map);
27 $valid = array_fuse($valid);
29 foreach ($xactions as $xaction) {
30 $value = $xaction->getNewValue();
32 if (!isset($valid[$value])) {
33 $errors[] = $this->newInvalidError(
35 'Import frequency "%s" is not valid. Valid frequencies are: %s.',
37 implode(', ', $valid)),