当前位置: 首页>>代码示例>>PHP>>正文


PHP Roles::getAdapter方法代码示例

本文整理汇总了PHP中Roles::getAdapter方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::getAdapter方法的具体用法?PHP Roles::getAdapter怎么用?PHP Roles::getAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Roles的用法示例。


在下文中一共展示了Roles::getAdapter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editsystemroleAction

 /** Edit a system role
  */
 public function editsystemroleAction()
 {
     $form = new SystemRoleForm();
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         if ($form->isValid($formData)) {
             $roles = new Roles();
             $updateData = array('role' => $form->getValue('role'), 'description' => $form->getValue('description'), 'updated' => $this->getTimeForForms(), 'updatedBy' => $this->getIdentityForForms());
             $where = array();
             $where[] = $roles->getAdapter()->quoteInto('id = ?', $this->_getParam('id'));
             $update = $roles->update($updateData, $where);
             $this->_flashMessenger->addMessage($form->getValue('role') . '\'s details updated.');
             $this->_redirect('/admin/systemroles/');
         } else {
             $form->populate($formData);
         }
     } else {
         // find id is expected in $params['id']
         $id = (int) $this->_request->getParam('id', 0);
         if ($id > 0) {
             $roles = new Roles();
             $roles = $roles->fetchRow('id=' . $id);
             $form->populate($roles->toArray());
         }
     }
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:29,代码来源:SystemController.php

示例2: findRolesCandidats

 function findRolesCandidats($annee)
 {
     $t = new Roles();
     $db = $t->getAdapter();
     $s = $t->select()->setIntegrityCheck(false)->from('unite_role')->join('unite_type', 'unite_type.id = unite_role.type', array())->join('unite', 'unite.type = unite_type.id', array())->joinLeft('appartenance', 'appartenance.role = unite_role.id AND ' . 'appartenance.unite = unite.id AND ' . ('(' . $db->quoteInto('appartenance.debut < ?', Strass_Controller_Action_Helper_Annee::dateFin($annee)) . ' AND ' . $db->quoteInto('(appartenance.fin IS NULL OR appartenance.fin < ?)', Strass_Controller_Action_Helper_Annee::dateFin($annee)) . ')'), array())->where('unite.id = ?', $this->id)->where('appartenance.id IS NULL');
     return $t->fetchAll($s);
 }
开发者ID:bersace,项目名称:strass,代码行数:7,代码来源:Unites.php

示例3: findRolesCandidats

 function findRolesCandidats($unite, $filter_current = true)
 {
     $t = new Roles();
     $db = $t->getAdapter();
     $s = $t->select()->setIntegrityCheck(false)->from('unite_role')->join('unite_type', 'unite_type.id = unite_role.type', array())->join('unite', 'unite.type = unite_type.id', array())->where('unite.id = ?', $unite->id);
     if ($filter_current) {
         $s->joinLeft('appartenance', 'appartenance.role = unite_role.id AND ' . 'appartenance.unite = unite.id AND ' . $db->quoteInto('appartenance.individu', $this->id), array())->where('appartenance.id IS NULL');
     }
     return $t->fetchAll($s);
 }
开发者ID:bersace,项目名称:strass,代码行数:10,代码来源:Individus.php


注:本文中的Roles::getAdapter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。