本文整理汇总了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;
}
示例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());
}
}
}