Page MenuHomePhabricator

D14897.id36008.diff
No OneTemporary

D14897.id36008.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1161,6 +1161,8 @@
'HeraldNewObjectField' => 'applications/herald/field/HeraldNewObjectField.php',
'HeraldNotifyActionGroup' => 'applications/herald/action/HeraldNotifyActionGroup.php',
'HeraldObjectTranscript' => 'applications/herald/storage/transcript/HeraldObjectTranscript.php',
+ 'HeraldPhameBlogAdapter' => 'applications/phame/herald/HeraldPhameBlogAdapter.php',
+ 'HeraldPhamePostAdapter' => 'applications/phame/herald/HeraldPhamePostAdapter.php',
'HeraldPholioMockAdapter' => 'applications/pholio/herald/HeraldPholioMockAdapter.php',
'HeraldPonderQuestionAdapter' => 'applications/ponder/herald/HeraldPonderQuestionAdapter.php',
'HeraldPreCommitAdapter' => 'applications/diffusion/herald/HeraldPreCommitAdapter.php',
@@ -5216,6 +5218,8 @@
'HeraldNewObjectField' => 'HeraldField',
'HeraldNotifyActionGroup' => 'HeraldActionGroup',
'HeraldObjectTranscript' => 'Phobject',
+ 'HeraldPhameBlogAdapter' => 'HeraldAdapter',
+ 'HeraldPhamePostAdapter' => 'HeraldAdapter',
'HeraldPholioMockAdapter' => 'HeraldAdapter',
'HeraldPonderQuestionAdapter' => 'HeraldAdapter',
'HeraldPreCommitAdapter' => 'HeraldAdapter',
diff --git a/src/applications/phame/herald/HeraldPhameBlogAdapter.php b/src/applications/phame/herald/HeraldPhameBlogAdapter.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phame/herald/HeraldPhameBlogAdapter.php
@@ -0,0 +1,62 @@
+<?php
+
+final class HeraldPhameBlogAdapter extends HeraldAdapter {
+
+ private $blog;
+
+ protected function newObject() {
+ return new PhameBlog();
+ }
+
+ public function getAdapterApplicationClass() {
+ return 'PhabricatorPhameApplication';
+ }
+
+ public function getAdapterContentDescription() {
+ return pht('React to Phame Blogs being created or updated.');
+ }
+
+ protected function initializeNewAdapter() {
+ $this->blog = $this->newObject();
+ }
+
+ public function supportsApplicationEmail() {
+ return true;
+ }
+
+ public function getRepetitionOptions() {
+ return array(
+ HeraldRepetitionPolicyConfig::EVERY,
+ HeraldRepetitionPolicyConfig::FIRST,
+ );
+ }
+
+ public function supportsRuleType($rule_type) {
+ switch ($rule_type) {
+ case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
+ case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
+ return true;
+ case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
+ default:
+ return false;
+ }
+ }
+
+ public function setblog(PhameBlog $blog) {
+ $this->blog = $blog;
+ return $this;
+ }
+
+ public function getObject() {
+ return $this->blog;
+ }
+
+ public function getAdapterContentName() {
+ return pht('Phame Blogs');
+ }
+
+ public function getHeraldName() {
+ return 'BLOG'.$this->getObject()->getID();
+ }
+
+}
diff --git a/src/applications/phame/herald/HeraldPhamePostAdapter.php b/src/applications/phame/herald/HeraldPhamePostAdapter.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phame/herald/HeraldPhamePostAdapter.php
@@ -0,0 +1,62 @@
+<?php
+
+final class HeraldPhamePostAdapter extends HeraldAdapter {
+
+ private $post;
+
+ protected function newObject() {
+ return new PhamePost();
+ }
+
+ public function getAdapterApplicationClass() {
+ return 'PhabricatorPhameApplication';
+ }
+
+ public function getAdapterContentDescription() {
+ return pht('React to Phame Posts being created or updated.');
+ }
+
+ protected function initializeNewAdapter() {
+ $this->post = $this->newObject();
+ }
+
+ public function supportsApplicationEmail() {
+ return true;
+ }
+
+ public function getRepetitionOptions() {
+ return array(
+ HeraldRepetitionPolicyConfig::EVERY,
+ HeraldRepetitionPolicyConfig::FIRST,
+ );
+ }
+
+ public function supportsRuleType($rule_type) {
+ switch ($rule_type) {
+ case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
+ case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
+ return true;
+ case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
+ default:
+ return false;
+ }
+ }
+
+ public function setpost(PhamePost $post) {
+ $this->post = $post;
+ return $this;
+ }
+
+ public function getObject() {
+ return $this->post;
+ }
+
+ public function getAdapterContentName() {
+ return pht('Phame Posts');
+ }
+
+ public function getHeraldName() {
+ return 'POST'.$this->getObject()->getID();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 27, 2:04 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7724601
Default Alt Text
D14897.id36008.diff (4 KB)

Event Timeline