Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.