1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-20 10:48:40 +01:00
phorge-phorge/src/infrastructure/customfield/field/PhabricatorStandardCustomField.php
epriestley 6ffbee115b Add ApplicationTransactions/CustomField based user profile editor
Summary:
Adds a profile edit controller (with just one field and on links to it) that uses ApplicationTransactions and CustomField.

{F45617}

My plan is to move the other profile fields to this interface and get rid of Settings -> Profile. Basically, these will be "settings":

  - Sex
  - Language
  - Timezone

These will be "profile":

  - Real Name
  - Title
  - Blurb
  - Profile Image (but I'm going to put this on a separate UI)
  - Other custom fields

Test Plan: Edited my realname using the new interface.

Reviewers: chad, seporaitis

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6152
2013-06-07 09:55:55 -07:00

72 lines
1.4 KiB
PHP

<?php
abstract class PhabricatorStandardCustomField
extends PhabricatorCustomField {
private $fieldKey;
private $fieldName;
private $fieldType;
private $fieldValue;
private $fieldDescription;
public function __construct($key) {
$this->fieldKey = $key;
}
public function setFieldName($name) {
$this->fieldName = $name;
return $this;
}
public function setFieldType($type) {
$this->fieldType = $type;
return $this;
}
public function getFieldValue() {
return $this->fieldValue;
}
public function setFieldValue($value) {
$this->fieldValue = $value;
return $this;
}
public function setFieldDescription($description) {
$this->fieldDescription = $description;
return $this;
}
/* -( PhabricatorCustomField )--------------------------------------------- */
public function getFieldKey() {
return $this->fieldKey;
}
public function getFieldName() {
return coalesce($this->fieldName, parent::getFieldName());
}
public function getFieldDescription() {
return coalesce($this->fieldDescription, parent::getFieldDescription());
}
public function getStorageKey() {
return $this->getFieldKey();
}
public function getValueForStorage() {
return $this->getFieldValue();
}
public function setValueFromStorage($value) {
return $this->setFieldValue($value);
}
public function shouldAppearInApplicationTransactions() {
return true;
}
}