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


PHP sfGuardGroupPeer::doSelectOne方法代码示例

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


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

示例1: getsfGuardGroup

 /**
  * Get the associated sfGuardGroup object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     sfGuardGroup The associated sfGuardGroup object.
  * @throws     PropelException
  */
 public function getsfGuardGroup(PropelPDO $con = null)
 {
     if ($this->asfGuardGroup === null && $this->group_id !== null) {
         $c = new Criteria(sfGuardGroupPeer::DATABASE_NAME);
         $c->add(sfGuardGroupPeer::ID, $this->group_id);
         $this->asfGuardGroup = sfGuardGroupPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->asfGuardGroup->addsfGuardUserGroups($this);
         		 */
     }
     return $this->asfGuardGroup;
 }
开发者ID:rewrewby,项目名称:propertyx,代码行数:23,代码来源:BasesfGuardUserGroup.php

示例2: loginRole

 /**
  * Chooses a role from the groups the user is in, right after the last one logs in.
  *
  */
 public function loginRole()
 {
     $c = new Criteria();
     $c->add(sfGuardUserGroupPeer::USER_ID, $this->getGuardUser()->getId(), Criteria::EQUAL);
     $c->addJoin(sfGuardGroupPeer::ID, sfGuardUserGroupPeer::GROUP_ID);
     $role = sfGuardGroupPeer::doSelectOne($c);
     if ($role) {
         if ($this->isPreceptor()) {
             $this->setLoginRole('Preceptor');
         } else {
             $this->setLoginRole($role->getName());
         }
     }
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:18,代码来源:myUser.class.php


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