Path: blob/master/src/applications/herald/field/HeraldContentSourceField.php
12256 views
<?php12final class HeraldContentSourceField extends HeraldField {34const FIELDCONST = 'contentsource';56public function getHeraldFieldName() {7return pht('Content source');8}910public function getFieldGroupKey() {11return HeraldEditFieldGroup::FIELDGROUPKEY;12}1314public function getHeraldFieldValue($object) {15return $this->getAdapter()->getContentSource()->getSource();16}1718public function getHeraldFieldConditions() {19return array(20HeraldAdapter::CONDITION_IS,21HeraldAdapter::CONDITION_IS_NOT,22);23}2425public function getHeraldFieldValueType($condition) {26$map = PhabricatorContentSource::getAllContentSources();27$map = mpull($map, 'getSourceName');28asort($map);2930return id(new HeraldSelectFieldValue())31->setKey(self::FIELDCONST)32->setDefault(PhabricatorWebContentSource::SOURCECONST)33->setOptions($map);34}3536public function supportsObject($object) {37return true;38}3940}414243