public function getHeraldField($field) { $log = $this->getObject(); switch ($field) { case self::FIELD_REF_TYPE: return $log->getRefType(); case self::FIELD_REF_NAME: return $log->getRefName(); case self::FIELD_REF_CHANGE: return $log->getChangeFlags(); case self::FIELD_REPOSITORY: return $this->getHookEngine()->getRepository()->getPHID(); case self::FIELD_REPOSITORY_PROJECTS: return $this->getHookEngine()->getRepository()->getProjectPHIDs(); case self::FIELD_PUSHER: return $this->getHookEngine()->getViewer()->getPHID(); case self::FIELD_PUSHER_PROJECTS: return $this->getHookEngine()->loadViewerProjectPHIDsForHerald(); } return parent::getHeraldField($field); }
public function getHeraldField($field) { $log = $this->getObject(); switch ($field) { case self::FIELD_BODY: return $this->getCommitRef()->getMessage(); case self::FIELD_AUTHOR: return $this->getAuthorPHID(); case self::FIELD_AUTHOR_RAW: return $this->getAuthorRaw(); case self::FIELD_COMMITTER: return $this->getCommitterPHID(); case self::FIELD_COMMITTER_RAW: return $this->getCommitterRaw(); case self::FIELD_BRANCHES: return $this->getBranches(); case self::FIELD_DIFF_FILE: return $this->getDiffContent('name'); case self::FIELD_DIFF_CONTENT: return $this->getDiffContent('*'); case self::FIELD_DIFF_ADDED_CONTENT: return $this->getDiffContent('+'); case self::FIELD_DIFF_REMOVED_CONTENT: return $this->getDiffContent('-'); case self::FIELD_DIFF_ENORMOUS: $this->getDiffContent('*'); return $this->changesets instanceof Exception; case self::FIELD_REPOSITORY: return $this->getHookEngine()->getRepository()->getPHID(); case self::FIELD_REPOSITORY_PROJECTS: return $this->getHookEngine()->getRepository()->getProjectPHIDs(); case self::FIELD_PUSHER: return $this->getHookEngine()->getViewer()->getPHID(); case self::FIELD_PUSHER_PROJECTS: return $this->getHookEngine()->loadViewerProjectPHIDsForHerald(); case self::FIELD_DIFFERENTIAL_REVISION: $revision = $this->getRevision(); if (!$revision) { return null; } return $revision->getPHID(); case self::FIELD_DIFFERENTIAL_ACCEPTED: $revision = $this->getRevision(); if (!$revision) { return null; } $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; if ($revision->getStatus() != $status_accepted) { return null; } return $revision->getPHID(); case self::FIELD_DIFFERENTIAL_REVIEWERS: $revision = $this->getRevision(); if (!$revision) { return array(); } return $revision->getReviewers(); case self::FIELD_DIFFERENTIAL_CCS: $revision = $this->getRevision(); if (!$revision) { return array(); } return $revision->getCCPHIDs(); case self::FIELD_IS_MERGE_COMMIT: return $this->getIsMergeCommit(); case self::FIELD_PUSHER_IS_COMMITTER: $pusher_phid = $this->getHookEngine()->getViewer()->getPHID(); return $this->getCommitterPHID() == $pusher_phid; } return parent::getHeraldField($field); }