Differential D16286 Diff 39160 src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php
- This file was added.
<?php | |||||
abstract class PhabricatorCalendarEventDateTransaction | |||||
extends PhabricatorCalendarEventTransactionType { | |||||
abstract protected function getInvalidDateMessage(); | |||||
public function generateNewValue($object, $value) { | |||||
return $value->getEpoch(); | |||||
} | |||||
public function validateTransactions($object, array $xactions) { | |||||
$errors = array(); | |||||
foreach ($xactions as $xaction) { | |||||
if ($xaction->getNewValue()->isValid()) { | |||||
continue; | |||||
} | |||||
$message = $this->getInvalidDateMessage(); | |||||
$errors[] = $this->newInvalidError($message, $xaction); | |||||
} | |||||
return $errors; | |||||
} | |||||
} |