当前位置: 首页>>代码示例>>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;未经允许,请勿转载。