Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / auth / factor / PhabricatorAuthFactorResult.php
blobb5da37954516ab7008319db428366b9ceec0eb4c
1 <?php
3 final class PhabricatorAuthFactorResult
4 extends Phobject {
6 private $answeredChallenge;
7 private $isWait = false;
8 private $isError = false;
9 private $isContinue = false;
10 private $errorMessage;
11 private $value;
12 private $issuedChallenges = array();
13 private $icon;
14 private $statusChallenge;
16 public function setAnsweredChallenge(PhabricatorAuthChallenge $challenge) {
17 if (!$challenge->getIsAnsweredChallenge()) {
18 throw new PhutilInvalidStateException('markChallengeAsAnswered');
21 if ($challenge->getIsCompleted()) {
22 throw new Exception(
23 pht(
24 'A completed challenge was provided as an answered challenge. '.
25 'The underlying factor is implemented improperly, challenges '.
26 'may not be reused.'));
29 $this->answeredChallenge = $challenge;
31 return $this;
34 public function getAnsweredChallenge() {
35 return $this->answeredChallenge;
38 public function setStatusChallenge(PhabricatorAuthChallenge $challenge) {
39 $this->statusChallenge = $challenge;
40 return $this;
43 public function getStatusChallenge() {
44 return $this->statusChallenge;
47 public function getIsValid() {
48 return (bool)$this->getAnsweredChallenge();
51 public function setIsWait($is_wait) {
52 $this->isWait = $is_wait;
53 return $this;
56 public function getIsWait() {
57 return $this->isWait;
60 public function setIsError($is_error) {
61 $this->isError = $is_error;
62 return $this;
65 public function getIsError() {
66 return $this->isError;
69 public function setIsContinue($is_continue) {
70 $this->isContinue = $is_continue;
71 return $this;
74 public function getIsContinue() {
75 return $this->isContinue;
78 public function setErrorMessage($error_message) {
79 $this->errorMessage = $error_message;
80 return $this;
83 public function getErrorMessage() {
84 return $this->errorMessage;
87 public function setValue($value) {
88 $this->value = $value;
89 return $this;
92 public function getValue() {
93 return $this->value;
96 public function setIcon(PHUIIconView $icon) {
97 $this->icon = $icon;
98 return $this;
101 public function getIcon() {
102 return $this->icon;