本文整理汇总了PHP中Presenter::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Presenter::save方法的具体用法?PHP Presenter::save怎么用?PHP Presenter::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Presenter
的用法示例。
在下文中一共展示了Presenter::save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
// todo validate format of a date...
if (!is_numeric($birth_year)) {
unset($user->data->date_of_birth);
}
}
if ($user->save()) {
$result->success = TRUE;
$result->message = "User saved successfully.";
if (isset($_POST['nickname'])) {
require_once APPLICATION_PATH . MODEL_DIR . '/Presenter.php';
$presenter = new Presenter();
$presenter_data = array();
$presenter_data['id'] = $_POST['presenter_id'];
$presenter_data['nickname'] = $_POST['nickname'];
$presenter->set($presenter_data);
$presenter->save();
}
if ($model == 'presenter' && $data['tax_exempt'] != $original_tax_exempt) {
require_once APPLICATION_PATH . MODEL_DIR . '/Admin_user_audit.php';
$audit = new Admin_user_audit();
$exempt_reason = !empty($exempt_reason) ? $exempt_reason : 'Admin3 Tax Exempt Status change. tax_exempt: ' . $data['tax_exempt'];
$audit->set(array('admin_user_id' => CakeSession::read('admin_user')->id, 'reference_name' => 'presenters.tax_exempt', 'reference_id' => $data['id'], 'old_value' => $original_tax_exempt, 'new_value' => $data['tax_exempt'], 'notes' => $exempt_reason));
$audit->save();
}
if ($model == 'email') {
//log email changes
$original = $_POST['original'];
$original_email = $original[$data['email_type_id']]['email'];
require_once APPLICATION_PATH . MODEL_DIR . '/Admin_user_audit.php';
$audit = new Admin_user_audit();
$audit->set(array('admin_user_id' => CakeSession::read('admin_user')->id, 'reference_name' => 'emails.id', 'reference_id' => $data['id'], 'old_value' => $original_email, 'new_value' => $data['email'], 'notes' => 'Admin3 Email change. email_type_id: ' . $data['email_type_id']));