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(); }
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; } }