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