1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00
phorge-phorge/src/applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php

28 lines
610 B
PHP
Raw Normal View History

<?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;
}
}