diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 746c2c50eb..801616cce1 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1382,6 +1382,7 @@ phutil_register_library_map(array( 'PhabricatorPeopleSearchEngine' => 'applications/people/query/PhabricatorPeopleSearchEngine.php', 'PhabricatorPeopleTestDataGenerator' => 'applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php', 'PhabricatorPhameConfigOptions' => 'applications/phame/config/PhabricatorPhameConfigOptions.php', + 'PhabricatorPhamePHIDTypeBlog' => 'applications/phame/phid/PhabricatorPhamePHIDTypeBlog.php', 'PhabricatorPholioConfigOptions' => 'applications/pholio/config/PhabricatorPholioConfigOptions.php', 'PhabricatorPholioMockTestDataGenerator' => 'applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php', 'PhabricatorPhortuneConfigOptions' => 'applications/phortune/option/PhabricatorPhortuneConfigOptions.php', @@ -3415,6 +3416,7 @@ phutil_register_library_map(array( 'PhabricatorPeopleSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorPeopleTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorPhameConfigOptions' => 'PhabricatorApplicationConfigOptions', + 'PhabricatorPhamePHIDTypeBlog' => 'PhabricatorPHIDType', 'PhabricatorPholioConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPholioMockTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorPhortuneConfigOptions' => 'PhabricatorApplicationConfigOptions', diff --git a/src/applications/phame/phid/PhabricatorPhamePHIDTypeBlog.php b/src/applications/phame/phid/PhabricatorPhamePHIDTypeBlog.php new file mode 100644 index 0000000000..e13d378a7c --- /dev/null +++ b/src/applications/phame/phid/PhabricatorPhamePHIDTypeBlog.php @@ -0,0 +1,45 @@ +setViewer($query->getViewer()) + ->withPHIDs($phids) + ->execute(); + } + + public function loadHandles( + PhabricatorHandleQuery $query, + array $handles, + array $objects) { + + foreach ($handles as $phid => $handle) { + $blog = $objects[$phid]; + $handle->setName($blog->getName()); + $handle->setFullName($blog->getName()); + $handle->setURI('/phame/blog/view/'.$blog->getID().'/'); + } + } + +} diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index 19f77c639f..45c79688c2 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -37,7 +37,7 @@ final class PhameBlog extends PhameDAO public function generatePHID() { return PhabricatorPHID::generateNewPHID( - PhabricatorPHIDConstants::PHID_TYPE_BLOG); + PhabricatorPhamePHIDTypeBlog::TYPECONST); } public function getSkinRenderer(AphrontRequest $request) { diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php index 5b3478020f..46c08b4a01 100644 --- a/src/applications/phid/PhabricatorObjectHandle.php +++ b/src/applications/phid/PhabricatorObjectHandle.php @@ -109,7 +109,6 @@ final class PhabricatorObjectHandle static $map = array( PhabricatorPHIDConstants::PHID_TYPE_USER => 'User', - PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'Blog', PhabricatorPHIDConstants::PHID_TYPE_POST => 'Post', ); diff --git a/src/applications/phid/PhabricatorPHIDConstants.php b/src/applications/phid/PhabricatorPHIDConstants.php index 73ac7c8cab..6e93d2553a 100644 --- a/src/applications/phid/PhabricatorPHIDConstants.php +++ b/src/applications/phid/PhabricatorPHIDConstants.php @@ -14,7 +14,6 @@ final class PhabricatorPHIDConstants { const PHID_TYPE_OASA = 'OASA'; const PHID_TYPE_POST = 'POST'; const PHID_TYPE_TOBJ = 'TOBJ'; - const PHID_TYPE_BLOG = 'BLOG'; const PHID_TYPE_ANSW = 'ANSW'; const PHID_TYPE_ACNT = 'ACNT'; const PHID_TYPE_PDCT = 'PDCT'; diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index 414aef6020..b5bbc5e1d9 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -90,13 +90,6 @@ final class PhabricatorObjectHandleData { } return mpull($xactions, null, 'getPHID'); - case PhabricatorPHIDConstants::PHID_TYPE_BLOG: - $blogs = id(new PhameBlogQuery()) - ->withPHIDs($phids) - ->setViewer($this->viewer) - ->execute(); - return mpull($blogs, null, 'getPHID'); - case PhabricatorPHIDConstants::PHID_TYPE_POST: $posts = id(new PhamePostQuery()) ->withPHIDs($phids) @@ -222,24 +215,6 @@ final class PhabricatorObjectHandleData { } break; - case PhabricatorPHIDConstants::PHID_TYPE_BLOG: - foreach ($phids as $phid) { - $handle = new PhabricatorObjectHandle(); - $handle->setPHID($phid); - $handle->setType($type); - if (empty($objects[$phid])) { - $handle->setName('Unknown Blog'); - } else { - $blog = $objects[$phid]; - $handle->setName($blog->getName()); - $handle->setFullName($blog->getName()); - $handle->setURI('/phame/blog/view/'.$blog->getID().'/'); - $handle->setComplete(true); - } - $handles[$phid] = $handle; - } - break; - case PhabricatorPHIDConstants::PHID_TYPE_POST: foreach ($phids as $phid) { $handle = new PhabricatorObjectHandle(); diff --git a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php index beb50997a3..0b72403ac4 100644 --- a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php +++ b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php @@ -156,7 +156,6 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants { static $class_map = array( PhabricatorPHIDConstants::PHID_TYPE_USER => 'PhabricatorUser', PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject', - PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'PhameBlog', PhabricatorPHIDConstants::PHID_TYPE_POST => 'PhamePost', PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer', PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount',