Page MenuHomePhabricator

Edit Engine Extension

Authored By
yelirekim
Feb 15 2016, 3:50 PM
Size
1 KB
Referenced Files
None
Subscribers
None

Edit Engine Extension

<?php
final class CIEnforcementEngineExtension extends PhabricatorEditEngineExtension {
const EXTENSIONKEY = 'enforcement.owners';
public function isExtensionEnabled() {
return true;
}
public function getExtensionName() {
return pht('Enforcement Policies');
}
public function supportsObject(
PhabricatorEditEngine $engine,
PhabricatorApplicationTransactionInterface $object) {
return
$engine instanceof PhabricatorOwnersPackageEditEngine &&
$object instanceof PhabricatorOwnersPackage;
}
public function buildCustomEditFields(
PhabricatorEditEngine $engine,
PhabricatorApplicationTransactionInterface $object) {
return [
id(new PhabricatorDatasourceEditField())
->setKey('owners')
->setLabel(pht('Enforced Owners'))
->setDescription(pht('Users and projects which own the package.'))
->setIsLocked(true)
->setTransactionType(PhabricatorOwnersPackageTransaction::TYPE_OWNERS)
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setIsCopyable(true)
->setValue($object->getOwnerPHIDs()),
];
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
52625
Default Alt Text
Edit Engine Extension (1 KB)

Event Timeline