3 final class PhabricatorCalendarEventHostTransaction
4 extends PhabricatorCalendarEventTransactionType
{
6 const TRANSACTIONTYPE
= 'calendar.host';
8 public function generateOldValue($object) {
9 return $object->getHostPHID();
12 public function applyInternalEffects($object, $value) {
13 $object->setHostPHID($value);
16 public function getTitle() {
18 '%s changed the host of this event from %s to %s.',
19 $this->renderAuthor(),
20 $this->renderOldHandle(),
21 $this->renderNewHandle());
24 public function getTitleForFeed() {
26 '%s changed the host of %s from %s to %s.',
27 $this->renderAuthor(),
28 $this->renderObject(),
29 $this->renderOldHandle(),
30 $this->renderNewHandle());
33 public function validateTransactions($object, array $xactions) {
36 foreach ($xactions as $xaction) {
37 $host_phid = $xaction->getNewValue();
39 $errors[] = $this->newRequiredError(
40 pht('Event host is required.'));
44 $user = id(new PhabricatorPeopleQuery())
45 ->setViewer($this->getActor())
46 ->withPHIDs(array($host_phid))
49 $errors[] = $this->newInvalidError(
51 'Host PHID "%s" is not a valid user PHID.',