本文整理汇总了PHP中People::fetchRow方法的典型用法代码示例。如果您正苦于以下问题:PHP People::fetchRow方法的具体用法?PHP People::fetchRow怎么用?PHP People::fetchRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类People
的用法示例。
在下文中一共展示了People::fetchRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
/** Edit a user's account
* @access public
* @return void
* @throws Pas_Exception_Param
*/
public function editAction()
{
if ($this->getParam('id', false)) {
$form = new EditAccountForm();
$form->submit->setLabel('Save details');
$form->removeElement('password');
$this->view->form = $form;
if ($this->_request->isPost()) {
if ($form->isValid($this->_request->getPost())) {
$updateData = $form->getValues();
$where = array();
$where[] = $this->getUsers()->getAdapter()->quoteInto('id = ?', $this->getParam('id'));
$oldData = $this->getUsers()->fetchRow('id=' . $this->getParam('id'))->toArray();
unset($updateData['person']);
$this->getUsers()->update($updateData, $where);
$this->_helper->audit($updateData, $oldData, 'UsersAudit', $this->getParam('id'), $this->getParam('id'));
$this->getFlash()->addMessage('You updated the account successfully.');
$this->redirect('/admin/users/account/username/' . $form->getValue('username'));
} else {
$form->populate($this->_request->getPost());
}
} else {
$id = (int) $this->_request->getParam('id', 0);
if ($id > 0) {
$user = $this->getUsers()->fetchRow('id =' . $this->getParam('id'));
if (!empty($user)) {
$data = $user->toArray();
if (isset($data['peopleID'])) {
$people = new People();
$person = $people->fetchRow($people->select()->where('secuid = ?', $data['peopleID']));
if ($person) {
$person = $person->toArray();
$form->peopleID->setValue($person['secuid']);
$form->person->setValue($person['fullname']);
}
}
$form->populate($user->toArray());
} else {
throw new Pas_Exception_Param('No user account found with that id');
}
}
}
} else {
throw new Pas_Exception_Param('No parameter found on url string');
}
}
示例2: getData
/** Get the data for the person
* @access public
* @return object
*/
public function getData()
{
$people = new People();
return $people->fetchRow($people->select()->where('secuid = ?', $this->getPersonID()));
}