本文整理汇总了PHP中CFactory::createSebTicket方法的典型用法代码示例。如果您正苦于以下问题:PHP CFactory::createSebTicket方法的具体用法?PHP CFactory::createSebTicket怎么用?PHP CFactory::createSebTicket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFactory
的用法示例。
在下文中一共展示了CFactory::createSebTicket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionWizardCompleted
public function actionWizardCompleted()
{
$speciality = CTaxonomyManager::getCacheSpecialities()->getItem(CRequest::getInt("speciality_id"));
$year = CTaxonomyManager::getCacheYears()->getItem(CRequest::getInt("year_id"));
$protocol = CProtocolManager::getDepProtocol(CRequest::getInt("protocol_id"));
$signer = CStaffManager::getPersonById(CRequest::getInt("signer_id"));
$disciplines = new CArrayList();
foreach (CRequest::getArray("discipline") as $i) {
$disciplines->add($disciplines->getCount(), CDisciplinesManager::getDiscipline($i));
}
// бегаем по циклу столько раз, сколько нам билетов нужно
for ($i = 1; $i <= CRequest::getInt("count"); $i++) {
$ticket = CFactory::createSebTicket();
$ticket->setSpeciality($speciality);
$ticket->setYear($year);
$ticket->setProtocol($protocol);
$ticket->setSigner($signer);
$ticket->setNumber($i);
foreach ($disciplines->getItems() as $disc) {
if ($disc->getQuestions()->getCount() == 0) {
break;
}
$question = $disc->getQuestions()->getShuffled()->getFirstItem();
$disc->getQuestions()->removeItem($question->getId());
$ticket->addQuestion($question);
}
$ticket->save();
}
$this->redirect("?action=index");
}