3 final class AlmanacInterfaceNetworkTransaction
4 extends AlmanacInterfaceTransactionType
{
6 const TRANSACTIONTYPE
= 'almanac:interface:network';
8 public function generateOldValue($object) {
9 return $object->getNetworkPHID();
12 public function applyInternalEffects($object, $value) {
13 $object->setNetworkPHID($value);
16 public function getTitle() {
18 '%s changed the network for this interface from %s to %s.',
19 $this->renderAuthor(),
20 $this->renderOldHandle(),
21 $this->renderNewHandle());
24 public function validateTransactions($object, array $xactions) {
27 $network_phid = $object->getNetworkPHID();
28 if ($this->isEmptyTextTransaction($network_phid, $xactions)) {
29 $errors[] = $this->newRequiredError(
30 pht('Interfaces must have a network.'));
33 foreach ($xactions as $xaction) {
34 $network_phid = $xaction->getNewValue();
36 $networks = id(new AlmanacNetworkQuery())
37 ->setViewer($this->getActor())
38 ->withPHIDs(array($network_phid))
41 $errors[] = $this->newInvalidError(
43 'You can not put an interface on a nonexistent or restricted '.