Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/editor/PhabricatorProfileMenuEditor.php
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: | case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_ORDER: | ||||
case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: | case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_VISIBILITY: | ||||
return; | return; | ||||
} | } | ||||
return parent::applyCustomExternalTransaction($object, $xaction); | return parent::applyCustomExternalTransaction($object, $xaction); | ||||
} | } | ||||
protected function validateTransaction( | |||||
PhabricatorLiskDAO $object, | |||||
$type, | |||||
array $xactions) { | |||||
$errors = parent::validateTransaction($object, $type, $xactions); | |||||
$actor = $this->getActor(); | |||||
$menu_item = $object->getMenuItem(); | |||||
$menu_item->setViewer($actor); | |||||
switch ($type) { | |||||
case PhabricatorProfileMenuItemConfigurationTransaction::TYPE_PROPERTY: | |||||
$key_map = array(); | |||||
foreach ($xactions as $xaction) { | |||||
$xaction_key = $xaction->getMetadataValue('property.key'); | |||||
$old = $this->getCustomTransactionOldValue($object, $xaction); | |||||
$new = $xaction->getNewValue(); | |||||
$key_map[$xaction_key][] = array( | |||||
'xaction' => $xaction, | |||||
'old' => $old, | |||||
'new' => $new, | |||||
); | |||||
} | |||||
foreach ($object->validateTransactions($key_map) as $error) { | |||||
$errors[] = $error; | |||||
} | |||||
break; | |||||
} | |||||
return $errors; | |||||
} | |||||
} | } |