mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Use application PHIDs for ATOM
Summary: Ref T2715. Test Plan: `phid.query` Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2715 Differential Revision: https://secure.phabricator.com/D6597
This commit is contained in:
parent
bdc93f65a2
commit
8d21dc0d52
4 changed files with 45 additions and 2 deletions
|
@ -533,6 +533,7 @@ phutil_register_library_map(array(
|
|||
'DivinerLiveBook' => 'applications/diviner/storage/DivinerLiveBook.php',
|
||||
'DivinerLivePublisher' => 'applications/diviner/publisher/DivinerLivePublisher.php',
|
||||
'DivinerLiveSymbol' => 'applications/diviner/storage/DivinerLiveSymbol.php',
|
||||
'DivinerPHIDTypeAtom' => 'applications/diviner/phid/DivinerPHIDTypeAtom.php',
|
||||
'DivinerPHIDTypeBook' => 'applications/diviner/phid/DivinerPHIDTypeBook.php',
|
||||
'DivinerPublishCache' => 'applications/diviner/cache/DivinerPublishCache.php',
|
||||
'DivinerPublisher' => 'applications/diviner/publisher/DivinerPublisher.php',
|
||||
|
@ -2537,6 +2538,7 @@ phutil_register_library_map(array(
|
|||
1 => 'PhabricatorPolicyInterface',
|
||||
2 => 'PhabricatorMarkupInterface',
|
||||
),
|
||||
'DivinerPHIDTypeAtom' => 'PhabricatorPHIDType',
|
||||
'DivinerPHIDTypeBook' => 'PhabricatorPHIDType',
|
||||
'DivinerPublishCache' => 'DivinerDiskCache',
|
||||
'DivinerRemarkupRuleSymbol' => 'PhutilRemarkupRule',
|
||||
|
|
42
src/applications/diviner/phid/DivinerPHIDTypeAtom.php
Normal file
42
src/applications/diviner/phid/DivinerPHIDTypeAtom.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
final class DivinerPHIDTypeAtom extends PhabricatorPHIDType {
|
||||
|
||||
const TYPECONST = 'ATOM';
|
||||
|
||||
public function getTypeConstant() {
|
||||
return self::TYPECONST;
|
||||
}
|
||||
|
||||
public function getTypeName() {
|
||||
return pht('Atom');
|
||||
}
|
||||
|
||||
public function newObject() {
|
||||
return new DivinerLiveSymbol();
|
||||
}
|
||||
|
||||
public function loadObjects(
|
||||
PhabricatorObjectQuery $query,
|
||||
array $phids) {
|
||||
|
||||
return id(new DivinerAtomQuery())
|
||||
->setViewer($query->getViewer())
|
||||
->withPHIDs($phids)
|
||||
->execute();
|
||||
}
|
||||
|
||||
public function loadHandles(
|
||||
PhabricatorHandleQuery $query,
|
||||
array $handles,
|
||||
array $objects) {
|
||||
|
||||
foreach ($handles as $phid => $handle) {
|
||||
$atom = $objects[$phid];
|
||||
|
||||
$handle->setName($atom->getTitle());
|
||||
$handle->setURI($atom->getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -29,7 +29,7 @@ final class DivinerLiveSymbol extends DivinerDAO
|
|||
|
||||
public function generatePHID() {
|
||||
return PhabricatorPHID::generateNewPHID(
|
||||
PhabricatorPHIDConstants::PHID_TYPE_ATOM);
|
||||
DivinerPHIDTypeAtom::TYPECONST);
|
||||
}
|
||||
|
||||
public function getBook() {
|
||||
|
|
|
@ -22,7 +22,6 @@ final class PhabricatorPHIDConstants {
|
|||
|
||||
const PHID_TYPE_XCMT = 'XCMT';
|
||||
|
||||
const PHID_TYPE_ATOM = 'ATOM';
|
||||
const PHID_TYPE_AUTH = 'AUTH';
|
||||
const PHID_TYPE_XOBJ = 'XOBJ';
|
||||
|
||||
|
|
Loading…
Reference in a new issue