本文整理匯總了PHP中Handler::persist方法的典型用法代碼示例。如果您正苦於以下問題:PHP Handler::persist方法的具體用法?PHP Handler::persist怎麽用?PHP Handler::persist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Handler
的用法示例。
在下文中一共展示了Handler::persist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processEditSingleAction
public function processEditSingleAction()
{
$type = (int) $this->_getParam('type');
$field = $this->_getParam('field');
$id = (int) $this->_getParam('id');
$value = preg_replace('/[^a-z_0-9- ]/i', '', $this->_getParam('value', ''));
$HSAHandler = new Handler();
$data = array();
$data['msg'] = __('Field name ' . $field . ' does not exist');
if (in_array($field, $HSAHandler->ormFields())) {
if ($id > 0) {
$HSAHandler->handlerId = $id;
$HSAHandler->populate();
}
$HSAHandler->{$field} = $value;
$HSAHandler->handlerType = $type;
$HSAHandler->persist();
$data['msg'] = __('Updated successfully');
}
$json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
$json->suppressExit = true;
$json->direct($data);
}