Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/drydock/customfield/DrydockBlueprintCoreCustomField.php
12256 views
1
<?php
2
3
final class DrydockBlueprintCoreCustomField
4
extends DrydockBlueprintCustomField
5
implements PhabricatorStandardCustomFieldInterface {
6
7
public function getStandardCustomFieldNamespace() {
8
return 'drydock:core';
9
}
10
11
public function createFields($object) {
12
// If this is a generic object without an attached implementation (for
13
// example, via ApplicationSearch), just don't build any custom fields.
14
if (!$object->hasImplementation()) {
15
return array();
16
}
17
18
$impl = $object->getImplementation();
19
$specs = $impl->getFieldSpecifications();
20
21
return PhabricatorStandardCustomField::buildStandardFields($this, $specs);
22
}
23
24
public function shouldUseStorage() {
25
return false;
26
}
27
28
public function readValueFromObject(PhabricatorCustomFieldInterface $object) {
29
$key = $this->getProxy()->getRawStandardFieldKey();
30
$this->setValueFromStorage($object->getDetail($key));
31
$this->didSetValueFromStorage();
32
}
33
34
public function applyApplicationTransactionInternalEffects(
35
PhabricatorApplicationTransaction $xaction) {
36
$object = $this->getObject();
37
$key = $this->getProxy()->getRawStandardFieldKey();
38
39
$this->setValueFromApplicationTransactions($xaction->getNewValue());
40
$value = $this->getValueForStorage();
41
42
$object->setDetail($key, $value);
43
}
44
45
public function getBlueprintFieldValue() {
46
return $this->getProxy()->getFieldValue();
47
}
48
49
}
50
51