コード例 #1
0
 private function updateQuestionState($conn)
 {
     $state = new \ExpertQuestionState();
     $state->setExperts(ExpertsQuery::create()->findOneByUsername($this->getExpert()));
     $state->setQuestionId($this->getQuestionId());
     $state->setIsResponded(true);
     $state->setIsRead(true);
     $state->save();
 }
コード例 #2
0
ファイル: FAQApi.php プロジェクト: menace690/Blue-Economics
 private function addQuestionToExpertQueue(\Questions $question, ObjectCollection $expertMembers)
 {
     $conn = Propel::getWriteConnection(ExpertQuestionStateTableMap::DATABASE_NAME);
     $conn->beginTransaction();
     try {
         foreach ($expertMembers as $member) {
             $qState = new \ExpertQuestionState();
             $qState->setUsername($member->getExpert());
             $qState->setQuestionId($question->getId());
             $qState->save($conn);
         }
         $conn->commit();
     } catch (\Exception $e) {
         $conn->rollback();
         throw $e;
     }
 }