Differential D17235 Diff 41452 src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | final class PhabricatorProfileMenuItemConfiguration | ||||
public function shouldEnableForObject($object) { | public function shouldEnableForObject($object) { | ||||
return $this->getMenuItem()->shouldEnableForObject($object); | return $this->getMenuItem()->shouldEnableForObject($object); | ||||
} | } | ||||
public function willBuildNavigationItems(array $items) { | public function willBuildNavigationItems(array $items) { | ||||
return $this->getMenuItem()->willBuildNavigationItems($items); | return $this->getMenuItem()->willBuildNavigationItems($items); | ||||
} | } | ||||
public function validateTransactions(array $map) { | |||||
$item = $this->getMenuItem(); | |||||
$fields = $item->buildEditEngineFields($this); | |||||
$errors = array(); | |||||
foreach ($fields as $field) { | |||||
$field_key = $field->getKey(); | |||||
$xactions = idx($map, $field_key, array()); | |||||
$value = $this->getMenuItemProperty($field_key); | |||||
$field_errors = $item->validateTransactions( | |||||
$this, | |||||
$field_key, | |||||
$value, | |||||
$xactions); | |||||
foreach ($field_errors as $error) { | |||||
$errors[] = $error; | |||||
} | |||||
} | |||||
return $errors; | |||||
} | |||||
public function getSortVector() { | public function getSortVector() { | ||||
// Sort custom items above global items. | // Sort custom items above global items. | ||||
if ($this->getCustomPHID()) { | if ($this->getCustomPHID()) { | ||||
$is_global = 0; | $is_global = 0; | ||||
} else { | } else { | ||||
$is_global = 1; | $is_global = 1; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |