當前位置: 首頁>>代碼示例>>PHP>>正文


PHP People::select方法代碼示例

本文整理匯總了PHP中People::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP People::select方法的具體用法?PHP People::select怎麽用?PHP People::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在People的用法示例。


在下文中一共展示了People::select方法的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');
     }
 }
開發者ID:lesleyauk,項目名稱:findsorguk,代碼行數:51,代碼來源:UsersController.php

示例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()));
 }
開發者ID:lesleyauk,項目名稱:findsorguk,代碼行數:9,代碼來源:PersonLookup.php


注:本文中的People::select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。