mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
36 lines
823 B
PHP
36 lines
823 B
PHP
|
<?php
|
||
|
|
||
|
final class PhabricatorCalendarExportNameTransaction
|
||
|
extends PhabricatorCalendarExportTransactionType {
|
||
|
|
||
|
const TRANSACTIONTYPE = 'calendar.export.name';
|
||
|
|
||
|
public function generateOldValue($object) {
|
||
|
return $object->getName();
|
||
|
}
|
||
|
|
||
|
public function applyInternalEffects($object, $value) {
|
||
|
$object->setName($value);
|
||
|
}
|
||
|
|
||
|
public function getTitle() {
|
||
|
return pht(
|
||
|
'%s renamed this export from %s to %s.',
|
||
|
$this->renderAuthor(),
|
||
|
$this->renderOldValue(),
|
||
|
$this->renderNewValue());
|
||
|
}
|
||
|
|
||
|
public function validateTransactions($object, array $xactions) {
|
||
|
$errors = array();
|
||
|
|
||
|
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) {
|
||
|
$errors[] = $this->newRequiredError(
|
||
|
pht('Calendar exports must have a name.'));
|
||
|
}
|
||
|
|
||
|
return $errors;
|
||
|
}
|
||
|
|
||
|
}
|