mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 15:00:58 +01:00
Make ReleephRequest implement PhabricatorCustomFieldInterface
Summary: Ref T3718. Doesn't do anything yet. Test Plan: Viewed and edited a request. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3718 Differential Revision: https://secure.phabricator.com/D6753
This commit is contained in:
parent
026137f92f
commit
f7b289e3a4
2 changed files with 30 additions and 1 deletions
|
@ -4177,6 +4177,7 @@ phutil_register_library_map(array(
|
||||||
array(
|
array(
|
||||||
0 => 'ReleephDAO',
|
0 => 'ReleephDAO',
|
||||||
1 => 'PhabricatorPolicyInterface',
|
1 => 'PhabricatorPolicyInterface',
|
||||||
|
2 => 'PhabricatorCustomFieldInterface',
|
||||||
),
|
),
|
||||||
'ReleephRequestActionController' => 'ReleephProjectController',
|
'ReleephRequestActionController' => 'ReleephProjectController',
|
||||||
'ReleephRequestCommentController' => 'ReleephProjectController',
|
'ReleephRequestCommentController' => 'ReleephProjectController',
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ReleephRequest extends ReleephDAO
|
final class ReleephRequest extends ReleephDAO
|
||||||
implements PhabricatorPolicyInterface {
|
implements
|
||||||
|
PhabricatorPolicyInterface,
|
||||||
|
PhabricatorCustomFieldInterface {
|
||||||
|
|
||||||
protected $phid;
|
protected $phid;
|
||||||
protected $branchID;
|
protected $branchID;
|
||||||
|
@ -21,6 +23,8 @@ final class ReleephRequest extends ReleephDAO
|
||||||
|
|
||||||
// Pre-populated handles that we'll bulk load in ReleephBranch
|
// Pre-populated handles that we'll bulk load in ReleephBranch
|
||||||
private $handles;
|
private $handles;
|
||||||
|
private $customFields = self::ATTACHABLE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -( Constants and helper methods )--------------------------------------- */
|
/* -( Constants and helper methods )--------------------------------------- */
|
||||||
|
@ -292,8 +296,10 @@ final class ReleephRequest extends ReleephDAO
|
||||||
return parent::setUserIntents($ar);
|
return parent::setUserIntents($ar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
public function getCapabilities() {
|
public function getCapabilities() {
|
||||||
return array(
|
return array(
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
PhabricatorPolicyCapability::CAN_VIEW,
|
||||||
|
@ -309,4 +315,26 @@ final class ReleephRequest extends ReleephDAO
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -( PhabricatorCustomFieldInterface )------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
|
public function getCustomFieldSpecificationForRole($role) {
|
||||||
|
return PhabricatorEnv::getEnvConfig('releeph.fields');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCustomFieldBaseClass() {
|
||||||
|
return 'ReleephFieldSpecification';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCustomFields() {
|
||||||
|
return $this->assertAttached($this->customFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) {
|
||||||
|
$this->customFields = $fields;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue