本文整理匯總了PHP中Help::getAdapter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Help::getAdapter方法的具體用法?PHP Help::getAdapter怎麽用?PHP Help::getAdapter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Help
的用法示例。
在下文中一共展示了Help::getAdapter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: editAction
/** Edit a help topic
* @access public
* @return void
* @throws Pas_Exception_Param
*/
public function editAction()
{
if ($this->getParam('id', false)) {
$form = new HelpForm();
$form->submit->setLabel('Submit changes');
$form->author->setValue($this->getIdentityForForms());
$this->view->form = $form;
if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) {
if ($form->isValid($form->getValues())) {
$where = array();
$where[] = $this->_help->getAdapter()->quoteInto('id = ?', $this->getParam('id'));
$this->_help->update($form->getValues(), $where);
$this->getFlash()->addMessage('You updated: <em>' . $form->getValue('title') . '</em> successfully. It is now available for use.');
$this->redirect('admin/help/');
} else {
$form->populate($form->getValues());
}
} else {
$form->populate($this->_help->fetchRow('id= ' . $this->getParam('id'))->toArray());
}
} else {
throw new Pas_Exception_Param($this->_missingParameter, 500);
}
}