Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ydsood/d1e279621bde8e854a79ba603fd4658b to your computer and use it in GitHub Desktop.
Save ydsood/d1e279621bde8e854a79ba603fd4658b to your computer and use it in GitHub Desktop.
<?php
final class PhabricatorStandardCustomFieldSelect
extends PhabricatorStandardCustomField {
//***************//
//Existing Code here
//**************//
/*
* Adding new function
*/
protected function newExportFieldType() {
return new PhabricatorSelectExportField($this); //Need to inject a reference to the instance of the object
}
}
<?php
final class PhabricatorSelectExportField
extends PhabricatorExportField {
private $phabricatorStandardCustomSelectField;
function __construct($_phabricatorStandardCustomSelectField){
$this->phabricatorStandardCustomSelectField = $_phabricatorStandardCustomSelectField;
}
public function setPhabricatorStandardCustomSelectField($value){
$this->phabricatorStandardCustomSelectField = $value;
return $this;
}
public function getPhabricatorStandardCustomSelectField(){
return $this->phabricatorStandardCustomSelectField;
}
public function getTextValue($value) {
$field = $this->getPhabricatorStandardCustomSelectField();
$field_Options = $field->getOptions();
return $field_Options[$value];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment