Remove VotableInterface from PonderQuestion
Summary: Ref T6920, This removes the PonderVotableInterface from PonderQuestion and assocaited code. Also... never used? Test Plan: Visit Ponder, See List, New Question, Add Answer. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T6920 Differential Revision: https://secure.phabricator.com/D13833
This commit is contained in:
2
resources/sql/autopatches/20150808.ponder.vote.1.sql
Normal file
2
resources/sql/autopatches/20150808.ponder.vote.1.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE {$NAMESPACE}_ponder.ponder_question
|
||||||
|
DROP COLUMN heat;
|
||||||
2
resources/sql/autopatches/20150808.ponder.vote.2.sql
Normal file
2
resources/sql/autopatches/20150808.ponder.vote.2.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE {$NAMESPACE}_ponder.ponder_question
|
||||||
|
DROP COLUMN voteCount;
|
||||||
@@ -3409,7 +3409,6 @@ phutil_register_library_map(array(
|
|||||||
'PonderQuestionCommentController' => 'applications/ponder/controller/PonderQuestionCommentController.php',
|
'PonderQuestionCommentController' => 'applications/ponder/controller/PonderQuestionCommentController.php',
|
||||||
'PonderQuestionEditController' => 'applications/ponder/controller/PonderQuestionEditController.php',
|
'PonderQuestionEditController' => 'applications/ponder/controller/PonderQuestionEditController.php',
|
||||||
'PonderQuestionEditor' => 'applications/ponder/editor/PonderQuestionEditor.php',
|
'PonderQuestionEditor' => 'applications/ponder/editor/PonderQuestionEditor.php',
|
||||||
'PonderQuestionHasVotingUserEdgeType' => 'applications/ponder/edge/PonderQuestionHasVotingUserEdgeType.php',
|
|
||||||
'PonderQuestionHistoryController' => 'applications/ponder/controller/PonderQuestionHistoryController.php',
|
'PonderQuestionHistoryController' => 'applications/ponder/controller/PonderQuestionHistoryController.php',
|
||||||
'PonderQuestionListController' => 'applications/ponder/controller/PonderQuestionListController.php',
|
'PonderQuestionListController' => 'applications/ponder/controller/PonderQuestionListController.php',
|
||||||
'PonderQuestionMailReceiver' => 'applications/ponder/mail/PonderQuestionMailReceiver.php',
|
'PonderQuestionMailReceiver' => 'applications/ponder/mail/PonderQuestionMailReceiver.php',
|
||||||
@@ -3432,7 +3431,6 @@ phutil_register_library_map(array(
|
|||||||
'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php',
|
'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php',
|
||||||
'PonderVoteSaveController' => 'applications/ponder/controller/PonderVoteSaveController.php',
|
'PonderVoteSaveController' => 'applications/ponder/controller/PonderVoteSaveController.php',
|
||||||
'PonderVotingUserHasAnswerEdgeType' => 'applications/ponder/edge/PonderVotingUserHasAnswerEdgeType.php',
|
'PonderVotingUserHasAnswerEdgeType' => 'applications/ponder/edge/PonderVotingUserHasAnswerEdgeType.php',
|
||||||
'PonderVotingUserHasQuestionEdgeType' => 'applications/ponder/edge/PonderVotingUserHasQuestionEdgeType.php',
|
|
||||||
'ProjectAddProjectsEmailCommand' => 'applications/project/command/ProjectAddProjectsEmailCommand.php',
|
'ProjectAddProjectsEmailCommand' => 'applications/project/command/ProjectAddProjectsEmailCommand.php',
|
||||||
'ProjectBoardTaskCard' => 'applications/project/view/ProjectBoardTaskCard.php',
|
'ProjectBoardTaskCard' => 'applications/project/view/ProjectBoardTaskCard.php',
|
||||||
'ProjectCanLockProjectsCapability' => 'applications/project/capability/ProjectCanLockProjectsCapability.php',
|
'ProjectCanLockProjectsCapability' => 'applications/project/capability/ProjectCanLockProjectsCapability.php',
|
||||||
@@ -7597,7 +7595,6 @@ phutil_register_library_map(array(
|
|||||||
'PonderDAO',
|
'PonderDAO',
|
||||||
'PhabricatorApplicationTransactionInterface',
|
'PhabricatorApplicationTransactionInterface',
|
||||||
'PhabricatorMarkupInterface',
|
'PhabricatorMarkupInterface',
|
||||||
'PonderVotableInterface',
|
|
||||||
'PhabricatorSubscribableInterface',
|
'PhabricatorSubscribableInterface',
|
||||||
'PhabricatorFlaggableInterface',
|
'PhabricatorFlaggableInterface',
|
||||||
'PhabricatorPolicyInterface',
|
'PhabricatorPolicyInterface',
|
||||||
@@ -7609,7 +7606,6 @@ phutil_register_library_map(array(
|
|||||||
'PonderQuestionCommentController' => 'PonderController',
|
'PonderQuestionCommentController' => 'PonderController',
|
||||||
'PonderQuestionEditController' => 'PonderController',
|
'PonderQuestionEditController' => 'PonderController',
|
||||||
'PonderQuestionEditor' => 'PonderEditor',
|
'PonderQuestionEditor' => 'PonderEditor',
|
||||||
'PonderQuestionHasVotingUserEdgeType' => 'PhabricatorEdgeType',
|
|
||||||
'PonderQuestionHistoryController' => 'PonderController',
|
'PonderQuestionHistoryController' => 'PonderController',
|
||||||
'PonderQuestionListController' => 'PonderController',
|
'PonderQuestionListController' => 'PonderController',
|
||||||
'PonderQuestionMailReceiver' => 'PhabricatorObjectMailReceiver',
|
'PonderQuestionMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||||
@@ -7631,7 +7627,6 @@ phutil_register_library_map(array(
|
|||||||
'PonderVoteEditor' => 'PhabricatorEditor',
|
'PonderVoteEditor' => 'PhabricatorEditor',
|
||||||
'PonderVoteSaveController' => 'PonderController',
|
'PonderVoteSaveController' => 'PonderController',
|
||||||
'PonderVotingUserHasAnswerEdgeType' => 'PhabricatorEdgeType',
|
'PonderVotingUserHasAnswerEdgeType' => 'PhabricatorEdgeType',
|
||||||
'PonderVotingUserHasQuestionEdgeType' => 'PhabricatorEdgeType',
|
|
||||||
'ProjectAddProjectsEmailCommand' => 'MetaMTAEmailTransactionCommand',
|
'ProjectAddProjectsEmailCommand' => 'MetaMTAEmailTransactionCommand',
|
||||||
'ProjectBoardTaskCard' => 'Phobject',
|
'ProjectBoardTaskCard' => 'Phobject',
|
||||||
'ProjectCanLockProjectsCapability' => 'PhabricatorPolicyCapability',
|
'ProjectCanLockProjectsCapability' => 'PhabricatorPolicyCapability',
|
||||||
|
|||||||
@@ -10,14 +10,11 @@ final class PonderQuestionViewController extends PonderController {
|
|||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($id))
|
->withIDs(array($id))
|
||||||
->needAnswers(true)
|
->needAnswers(true)
|
||||||
->needViewerVotes(true)
|
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$question) {
|
if (!$question) {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
$question->attachVotes($viewer->getPHID());
|
|
||||||
|
|
||||||
$question_xactions = $this->buildQuestionTransactions($question);
|
$question_xactions = $this->buildQuestionTransactions($question);
|
||||||
$answers = $this->buildAnswers($question->getAnswers());
|
$answers = $this->buildAnswers($question->getAnswers());
|
||||||
|
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
final class PonderQuestionHasVotingUserEdgeType extends PhabricatorEdgeType {
|
|
||||||
|
|
||||||
const EDGECONST = 17;
|
|
||||||
|
|
||||||
public function shouldWriteInverseTransactions() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getInverseEdgeConstant() {
|
|
||||||
return PonderVotingUserHasQuestionEdgeType::EDGECONST;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionAddString(
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$add_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s added %s voting user(s): %s.',
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$add_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionRemoveString(
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s removed %s voting user(s): %s.',
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionEditString(
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s edited %s voting user(s), added %s: %s; removed %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedAddString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$add_count,
|
|
||||||
$add_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s added %s voting user(s) to %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$object,
|
|
||||||
$add_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedRemoveString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s removed %s voting user(s) from %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$object,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedEditString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s edited %s voting user(s) for %s, added %s: %s; removed %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$object,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
final class PonderVotingUserHasQuestionEdgeType extends PhabricatorEdgeType {
|
|
||||||
|
|
||||||
const EDGECONST = 18;
|
|
||||||
|
|
||||||
public function shouldWriteInverseTransactions() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getInverseEdgeConstant() {
|
|
||||||
return PonderQuestionHasVotingUserEdgeType::EDGECONST;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionAddString(
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$add_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s added %s question(s): %s.',
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$add_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionRemoveString(
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s removed %s question(s): %s.',
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTransactionEditString(
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s edited %s question(s), added %s: %s; removed %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedAddString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$add_count,
|
|
||||||
$add_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s added %s question(s) to %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$add_count,
|
|
||||||
$object,
|
|
||||||
$add_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedRemoveString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s removed %s question(s) from %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$rem_count,
|
|
||||||
$object,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFeedEditString(
|
|
||||||
$actor,
|
|
||||||
$object,
|
|
||||||
$total_count,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges) {
|
|
||||||
|
|
||||||
return pht(
|
|
||||||
'%s edited %s question(s) for %s, added %s: %s; removed %s: %s.',
|
|
||||||
$actor,
|
|
||||||
$total_count,
|
|
||||||
$object,
|
|
||||||
$add_count,
|
|
||||||
$add_edges,
|
|
||||||
$rem_count,
|
|
||||||
$rem_edges);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -12,7 +12,6 @@ final class PonderQuestionQuery
|
|||||||
private $needProjectPHIDs;
|
private $needProjectPHIDs;
|
||||||
|
|
||||||
private $needAnswers;
|
private $needAnswers;
|
||||||
private $needViewerVotes;
|
|
||||||
|
|
||||||
public function withIDs(array $ids) {
|
public function withIDs(array $ids) {
|
||||||
$this->ids = $ids;
|
$this->ids = $ids;
|
||||||
@@ -44,11 +43,6 @@ final class PonderQuestionQuery
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function needViewerVotes($need_viewer_votes) {
|
|
||||||
$this->needViewerVotes = $need_viewer_votes;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function needProjectPHIDs($need_projects) {
|
public function needProjectPHIDs($need_projects) {
|
||||||
$this->needProjectPHIDs = $need_projects;
|
$this->needProjectPHIDs = $need_projects;
|
||||||
return $this;
|
return $this;
|
||||||
@@ -106,10 +100,6 @@ final class PonderQuestionQuery
|
|||||||
->setOrderVector(array('-id'))
|
->setOrderVector(array('-id'))
|
||||||
->withQuestionIDs(mpull($questions, 'getID'));
|
->withQuestionIDs(mpull($questions, 'getID'));
|
||||||
|
|
||||||
if ($this->needViewerVotes) {
|
|
||||||
$aquery->needViewerVotes($this->needViewerVotes);
|
|
||||||
}
|
|
||||||
|
|
||||||
$answers = $aquery->execute();
|
$answers = $aquery->execute();
|
||||||
$answers = mgroup($answers, 'getQuestionID');
|
$answers = mgroup($answers, 'getQuestionID');
|
||||||
|
|
||||||
@@ -119,26 +109,6 @@ final class PonderQuestionQuery
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->needViewerVotes) {
|
|
||||||
$viewer_phid = $this->getViewer()->getPHID();
|
|
||||||
|
|
||||||
$etype = PonderQuestionHasVotingUserEdgeType::EDGECONST;
|
|
||||||
$edges = id(new PhabricatorEdgeQuery())
|
|
||||||
->withSourcePHIDs($phids)
|
|
||||||
->withDestinationPHIDs(array($viewer_phid))
|
|
||||||
->withEdgeTypes(array($etype))
|
|
||||||
->needEdgeData(true)
|
|
||||||
->execute();
|
|
||||||
foreach ($questions as $question) {
|
|
||||||
$user_edge = idx(
|
|
||||||
$edges[$question->getPHID()][$etype],
|
|
||||||
$viewer_phid,
|
|
||||||
array());
|
|
||||||
|
|
||||||
$question->attachUserVote($viewer_phid, idx($user_edge, 'data', 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->needProjectPHIDs) {
|
if ($this->needProjectPHIDs) {
|
||||||
$edge_query = id(new PhabricatorEdgeQuery())
|
$edge_query = id(new PhabricatorEdgeQuery())
|
||||||
->withSourcePHIDs($phids)
|
->withSourcePHIDs($phids)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ final class PonderQuestion extends PonderDAO
|
|||||||
implements
|
implements
|
||||||
PhabricatorApplicationTransactionInterface,
|
PhabricatorApplicationTransactionInterface,
|
||||||
PhabricatorMarkupInterface,
|
PhabricatorMarkupInterface,
|
||||||
PonderVotableInterface,
|
|
||||||
PhabricatorSubscribableInterface,
|
PhabricatorSubscribableInterface,
|
||||||
PhabricatorFlaggableInterface,
|
PhabricatorFlaggableInterface,
|
||||||
PhabricatorPolicyInterface,
|
PhabricatorPolicyInterface,
|
||||||
@@ -25,13 +24,10 @@ final class PonderQuestion extends PonderDAO
|
|||||||
protected $viewPolicy;
|
protected $viewPolicy;
|
||||||
protected $spacePHID;
|
protected $spacePHID;
|
||||||
|
|
||||||
protected $voteCount;
|
|
||||||
protected $answerCount;
|
protected $answerCount;
|
||||||
protected $heat;
|
|
||||||
protected $mailKey;
|
protected $mailKey;
|
||||||
|
|
||||||
private $answers;
|
private $answers;
|
||||||
private $vote;
|
|
||||||
private $comments;
|
private $comments;
|
||||||
|
|
||||||
private $projectPHIDs = self::ATTACHABLE;
|
private $projectPHIDs = self::ATTACHABLE;
|
||||||
@@ -49,9 +45,7 @@ final class PonderQuestion extends PonderDAO
|
|||||||
->setAuthorPHID($actor->getPHID())
|
->setAuthorPHID($actor->getPHID())
|
||||||
->setViewPolicy($view_policy)
|
->setViewPolicy($view_policy)
|
||||||
->setStatus(PonderQuestionStatus::STATUS_OPEN)
|
->setStatus(PonderQuestionStatus::STATUS_OPEN)
|
||||||
->setVoteCount(0)
|
|
||||||
->setAnswerCount(0)
|
->setAnswerCount(0)
|
||||||
->setHeat(0.0)
|
|
||||||
->setSpacePHID($actor->getDefaultSpacePHID());
|
->setSpacePHID($actor->getDefaultSpacePHID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,10 +54,8 @@ final class PonderQuestion extends PonderDAO
|
|||||||
self::CONFIG_AUX_PHID => true,
|
self::CONFIG_AUX_PHID => true,
|
||||||
self::CONFIG_COLUMN_SCHEMA => array(
|
self::CONFIG_COLUMN_SCHEMA => array(
|
||||||
'title' => 'text255',
|
'title' => 'text255',
|
||||||
'voteCount' => 'sint32',
|
|
||||||
'status' => 'text32',
|
'status' => 'text32',
|
||||||
'content' => 'text',
|
'content' => 'text',
|
||||||
'heat' => 'double',
|
|
||||||
'answerCount' => 'uint32',
|
'answerCount' => 'uint32',
|
||||||
'mailKey' => 'bytes20',
|
'mailKey' => 'bytes20',
|
||||||
|
|
||||||
@@ -80,9 +72,6 @@ final class PonderQuestion extends PonderDAO
|
|||||||
'authorPHID' => array(
|
'authorPHID' => array(
|
||||||
'columns' => array('authorPHID'),
|
'columns' => array('authorPHID'),
|
||||||
),
|
),
|
||||||
'heat' => array(
|
|
||||||
'columns' => array('heat'),
|
|
||||||
),
|
|
||||||
'status' => array(
|
'status' => array(
|
||||||
'columns' => array('status'),
|
'columns' => array('status'),
|
||||||
),
|
),
|
||||||
@@ -103,49 +92,6 @@ final class PonderQuestion extends PonderDAO
|
|||||||
return PhabricatorContentSource::newFromSerialized($this->contentSource);
|
return PhabricatorContentSource::newFromSerialized($this->contentSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function attachVotes($user_phid) {
|
|
||||||
$qa_phids = mpull($this->answers, 'getPHID') + array($this->getPHID());
|
|
||||||
|
|
||||||
$edges = id(new PhabricatorEdgeQuery())
|
|
||||||
->withSourcePHIDs(array($user_phid))
|
|
||||||
->withDestinationPHIDs($qa_phids)
|
|
||||||
->withEdgeTypes(
|
|
||||||
array(
|
|
||||||
PonderVotingUserHasQuestionEdgeType::EDGECONST,
|
|
||||||
PonderVotingUserHasAnswerEdgeType::EDGECONST,
|
|
||||||
))
|
|
||||||
->needEdgeData(true)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$question_edge =
|
|
||||||
$edges[$user_phid][PonderVotingUserHasQuestionEdgeType::EDGECONST];
|
|
||||||
$answer_edges =
|
|
||||||
$edges[$user_phid][PonderVotingUserHasAnswerEdgeType::EDGECONST];
|
|
||||||
$edges = null;
|
|
||||||
|
|
||||||
$this->setUserVote(idx($question_edge, $this->getPHID()));
|
|
||||||
foreach ($this->answers as $answer) {
|
|
||||||
$answer->setUserVote(idx($answer_edges, $answer->getPHID()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setUserVote($vote) {
|
|
||||||
$this->vote = $vote['data'];
|
|
||||||
if (!$this->vote) {
|
|
||||||
$this->vote = PonderVote::VOTE_NONE;
|
|
||||||
}
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function attachUserVote($user_phid, $vote) {
|
|
||||||
$this->vote = $vote;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getUserVote() {
|
|
||||||
return $this->vote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setComments($comments) {
|
public function setComments($comments) {
|
||||||
$this->comments = $comments;
|
$this->comments = $comments;
|
||||||
return $this;
|
return $this;
|
||||||
@@ -229,15 +175,6 @@ final class PonderQuestion extends PonderDAO
|
|||||||
return (bool)$this->getID();
|
return (bool)$this->getID();
|
||||||
}
|
}
|
||||||
|
|
||||||
// votable interface
|
|
||||||
public function getUserVoteEdgeType() {
|
|
||||||
return PonderVotingUserHasQuestionEdgeType::EDGECONST;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getVotablePHID() {
|
|
||||||
return $this->getPHID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function save() {
|
public function save() {
|
||||||
if (!$this->getMailKey()) {
|
if (!$this->getMailKey()) {
|
||||||
$this->setMailKey(Filesystem::readRandomCharacters(20));
|
$this->setMailKey(Filesystem::readRandomCharacters(20));
|
||||||
|
|||||||
Reference in New Issue
Block a user