Page MenuHomePhabricator
Paste P1201

ProjectCustomField.php
ActivePublic

Authored by bluehawk on Jul 12 2014, 2:57 AM.
<?php
final class ProjectCustomField extends PhabricatorProjectCustomField
implements PhabricatorStandardCustomFieldInterface {
public function __construct() {
$proxy = id(new PhabricatorStandardCustomFieldDate())
->setFieldKey($this->getFieldKey())
->setApplicationField($this)
->setFieldConfig(array(
'name' => $this->getFieldName(),
'description' => $this->getFieldDescription(),
));
$this->setProxy($proxy);
}
public function getStandardCustomFieldNamespace() {
return 'project';
}
// == General field identity stuff
public function getFieldKey() {
return 'sprint:startdate';
}
public function getFieldName() {
return 'Sprint Start Date';
}
public function getFieldDescription() {
return 'When a sprint starts';
}
public function renderPropertyViewValue(array $handles) {
if ($this->getProxy()->getFieldValue())
{
return parent::renderPropertyViewValue($handles);
}
return null;
}
// == Search
public function shouldAppearInApplicationSearch()
{
return true;
}
}

Event Timeline

bluehawk changed the title of this paste from untitled to ProjectCustomField.php.
bluehawk updated the paste's language from autodetect to autodetect.