本文整理汇总了PHP中Cases::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Cases::save方法的具体用法?PHP Cases::save怎么用?PHP Cases::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cases
的用法示例。
在下文中一共展示了Cases::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($post)
{
$model = new Cases();
$model->setAttributes($post);
if (isset($post['date_prosecution'])) {
$model->date_prosecution = strtotime($post['date_prosecution']);
}
if ($model->save(FALSE)) {
return TRUE;
}
return FALSE;
}
示例2: actionCreate
/**
* Creates a new model.
* @return create view
*/
public function actionCreate()
{
// check if user has permissions to createCases
if (Yii::app()->user->checkAccess('createCases')) {
// create Cases object model
$model = new Cases();
// if Cases form exist and was sent
if (isset($_POST['Cases'])) {
// set form elements to Budgets model attributes
$model->attributes = $_POST['Cases'];
$model->case_date = date("Y-m-d");
$model->project_id = Yii::app()->user->getState('project_selected');
// validate and save
if ($model->save()) {
// save log
$attributes = array('log_date' => date("Y-m-d G:i:s"), 'log_activity' => 'CaseCreated', 'log_resourceid' => $model->primaryKey, 'log_type' => Logs::LOG_CREATED, 'user_id' => Yii::app()->user->id, 'module_id' => Yii::app()->controller->id, 'project_id' => $model->project_id);
Logs::model()->saveLog($attributes);
// to prevent F5 keypress, redirect to create page
$this->redirect(array('view', 'id' => $model->case_id));
}
}
$this->render('create', array('model' => $model));
} else {
throw new CHttpException(403, Yii::t('site', '403_Error'));
}
}
示例3: array
$Cases[$i0] = array('id' => @$r['0.' . $i0 . '.0'], 'nr' => @$r['0.' . $i0 . '.0'], 'area of law' => @$r['0.' . $i0 . '.2']);
$Cases[$i0]['session'] = array();
for ($i1 = 0; isset($r['0.' . $i0 . '.1.' . $i1]); $i1++) {
$Cases[$i0]['session'][$i1] = @$r['0.' . $i0 . '.1.' . $i1 . ''];
}
$Cases[$i0]['type of case'] = array();
for ($i1 = 0; isset($r['0.' . $i0 . '.3.' . $i1]); $i1++) {
$Cases[$i0]['type of case'][$i1] = @$r['0.' . $i0 . '.3.' . $i1 . ''];
}
$Cases[$i0]['court'] = array();
for ($i1 = 0; isset($r['0.' . $i0 . '.4.' . $i1]); $i1++) {
$Cases[$i0]['court'][$i1] = @$r['0.' . $i0 . '.4.' . $i1 . ''];
}
}
$Cases = new Cases($Cases);
if ($Cases->save() !== false) {
die('ok:' . $_SERVER['PHP_SELF']);
} else {
die('');
}
exit;
// do not show the interface
}
$buttons = "";
if (isset($_REQUEST['edit'])) {
$edit = true;
} else {
$edit = false;
}
$Cases = new Cases();
writeHead("<TITLE>Cases - VIRO - ADL Prototype</TITLE>" . ($edit ? '<SCRIPT type="text/javascript" src="edit.js"></SCRIPT>' : '<SCRIPT type="text/javascript" src="navigate.js"></SCRIPT>') . "\n");