2015-06-08 12:20:16 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorSearchDatasourceField
|
|
|
|
extends PhabricatorSearchTokenizerField {
|
|
|
|
|
|
|
|
private $datasource;
|
2015-12-13 07:43:02 -08:00
|
|
|
private $conduitParameterType;
|
2015-06-08 12:20:16 -07:00
|
|
|
|
|
|
|
protected function newDatasource() {
|
|
|
|
return id(clone $this->datasource);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setDatasource(PhabricatorTypeaheadDatasource $datasource) {
|
|
|
|
$this->datasource = $datasource;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-12-13 07:43:02 -08:00
|
|
|
public function setConduitParameterType(ConduitParameterType $type) {
|
|
|
|
$this->conduitParameterType = $type;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-12-13 07:29:05 -08:00
|
|
|
protected function newConduitParameterType() {
|
2015-12-13 07:43:02 -08:00
|
|
|
if (!$this->conduitParameterType) {
|
|
|
|
return new ConduitStringListParameterType();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->conduitParameterType;
|
2015-12-13 07:29:05 -08:00
|
|
|
}
|
|
|
|
|
2015-06-08 12:20:16 -07:00
|
|
|
}
|