本文整理匯總了PHP中Formulario::objects方法的典型用法代碼示例。如果您正苦於以下問題:PHP Formulario::objects方法的具體用法?PHP Formulario::objects怎麽用?PHP Formulario::objects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Formulario
的用法示例。
在下文中一共展示了Formulario::objects方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: do_crea_cerrada
public function do_crea_cerrada(View $view)
{
$enunciado = $view->getPOST('enunciado', false);
$formulari = $view->getPOST('formulario', false);
$enques = Session::get('encuestador');
if ($enunciado && $formulari && $enques) {
$forms = Formulario::objects()->filter(array("pk = {$formulari}", "encuestador_id__pk = " . $enques->get_pk()));
if ($forms->len()) {
$preg = Pregunta::instance();
$preg->setEnunciado($enunciado);
$preg->setFormulario_id($formulari);
$pgid = $preg->save();
if ($pgid > 0) {
$cerrada = Pregunta_cerrada::instance();
$cerrada->setPregunta_id($pgid);
$idce = $cerrada->save();
if ($idce > 0) {
return array('id_preg' => $pgid, 'id_cerrada' => $idce, 'enunciado' => $enunciado);
}
}
}
}
return $view->response_error();
}
示例2: ver_edit_form
public function ver_edit_form()
{
$user = Session::get_user();
if ($user != null && $user->getVerified()) {
$form = parent::getGET('form', false);
$service = Service::getInstance();
$forms = Formulario::objects()->filter(array("pk = {$form}"));
if ($forms->len() > 0) {
$form = $forms->get(0);
$pregs = $service->get_data_form($this);
return parent::render("index.html", array('content' => parent::render('edit_form.html', array('form' => $form, 'pregs' => $pregs))));
}
} else {
header("Location: ?ID=login");
exit(0);
}
}