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


PHP sfGuardGroupPeer::retrieveByPK方法代码示例

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


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

示例1: executeJsonUpdate

 public function executeJsonUpdate(sfWebRequest $request)
 {
     $isAjax = $request->isXmlHttpRequest();
     if (!$isAjax) {
         return $this->redirect('@homepage');
     }
     $id = $request->getParameter('id');
     $group = sfGuardGroupPeer::retrieveByPK($id);
     if (!$group) {
         $group_form = new sfGuardGroupForm();
     } else {
         $group_form = new sfGuardGroupForm($group);
     }
     $result = $this->processForm($request, $group_form);
     try {
         // remove existing permissions for the given group
         $c = new Criteria();
         $c->add(EtvaPermissionGroupPeer::GROUP_ID, $request->getParameter('id'), Criteria::EQUAL);
         $g_p = EtvaPermissionGroupPeer::doSelect($c);
         //filter group permissions
         foreach ($g_p as $p) {
             $p->delete();
         }
         // add new permission set
         $perm_list = $request->getParameter('sf_guard_group_permission_list');
         $perm_list_dec = json_decode($perm_list);
         foreach ($perm_list_dec as $object) {
             $g_p = new EtvaPermissionGroup();
             $g_p->setGroupId($request->getParameter('id'));
             $g_p->setEtvapermId($object);
             $g_p->save();
         }
     } catch (Exception $e) {
         $result = array('success' => false, 'error' => 'Could not perform operation', 'agent' => sfConfig::get('config_acronym'), 'info' => 'Could not perform operation');
     }
     if (!$result['success']) {
         $error = $this->setJsonError($result);
         return $this->renderText($error);
     }
     $msg_i18n = $this->getContext()->getI18N()->__('Group saved successfully');
     $response = array('success' => true, 'agent' => 'Central Management', 'response' => $msg_i18n, 'group_id' => $result['object']['Id']);
     $return = json_encode($response);
     $this->getResponse()->setHttpHeader('Content-type', 'application/json');
     return $this->renderText($return);
 }
开发者ID:ketheriel,项目名称:ETVA,代码行数:45,代码来源:actions.class.php

示例2: getsfGuardGroup

 public function getsfGuardGroup($con = null)
 {
     if ($this->asfGuardGroup === null && $this->group_id !== null) {
         include_once 'plugins/sfGuardPlugin/lib/model/om/BasesfGuardGroupPeer.php';
         $this->asfGuardGroup = sfGuardGroupPeer::retrieveByPK($this->group_id, $con);
     }
     return $this->asfGuardGroup;
 }
开发者ID:net7,项目名称:Talia-CMS,代码行数:8,代码来源:BasesfGuardUserGroup.php

示例3: executeEditWin

 public function executeEditWin(sfWebRequest $request)
 {
     $this->sf_guard_group = sfGuardGroupPeer::retrieveByPK($request->getParameter('id'));
     $this->form = $this->configuration->getForm($this->sf_guard_group);
     //die ('$request->getParameter(id): '.$request->getParameter('id'));
 }
开发者ID:retrofox,项目名称:PCC,代码行数:6,代码来源:actions.class.php

示例4: groupExists

 /**
  * Check if a group exists given to an id.
  * @param Int $group_id
  * @return Boolean
  */
 public static function groupExists($id)
 {
     return sfGuardGroupPeer::retrieveByPK($id) ? true : false;
 }
开发者ID:noreiller,项目名称:sfPlopPlugin,代码行数:9,代码来源:sfPlopGuard.class.php

示例5: executeChangeRole

 public function executeChangeRole($request)
 {
     $this->form = new ChangeRoleForm(array(), array('actual_user' => $this->getUser()));
     $values = $request->getParameter($this->form->getName());
     if (isset($values['roles']) && !empty($values['roles'])) {
         $this->getUser()->clearCredentials();
         $new_login_role = sfGuardGroupPeer::retrieveByPK($values['roles']);
         $this->getUser()->setLoginRole($new_login_role->getName());
         //die(var_dump($this->getUser()->getAttribute('login_role')));
         $this->getUser()->addCredentials(sfGuardPermissionPeer::retrieveAllCredentialsForARole(sfGuardGroupPeer::retrieveByName($this->getUser()->getLoginRole())));
     }
     return $this->redirect("mainBackend/index");
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:13,代码来源:actions.class.php


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