mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
28 lines
610 B
PHP
28 lines
610 B
PHP
|
<?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;
|
||
|
}
|
||
|
|
||
|
}
|