本文整理匯總了PHP中sfGuardUserGroupPeer::doSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfGuardUserGroupPeer::doSelect方法的具體用法?PHP sfGuardUserGroupPeer::doSelect怎麽用?PHP sfGuardUserGroupPeer::doSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfGuardUserGroupPeer
的用法示例。
在下文中一共展示了sfGuardUserGroupPeer::doSelect方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getsfGuardUserGroups
/**
* Gets an array of sfGuardUserGroup objects which contain a foreign key that references this object.
*
* If this collection has already been initialized with an identical Criteria, it returns the collection.
* Otherwise if this sfGuardUser has previously been saved, it will retrieve
* related sfGuardUserGroups from storage. If this sfGuardUser is new, it will return
* an empty collection or the current collection, the criteria is ignored on a new object.
*
* @param PropelPDO $con
* @param Criteria $criteria
* @return array sfGuardUserGroup[]
* @throws PropelException
*/
public function getsfGuardUserGroups($criteria = null, PropelPDO $con = null)
{
if ($criteria === null) {
$criteria = new Criteria(sfGuardUserPeer::DATABASE_NAME);
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
if ($this->collsfGuardUserGroups === null) {
if ($this->isNew()) {
$this->collsfGuardUserGroups = array();
} else {
$criteria->add(sfGuardUserGroupPeer::USER_ID, $this->id);
sfGuardUserGroupPeer::addSelectColumns($criteria);
$this->collsfGuardUserGroups = sfGuardUserGroupPeer::doSelect($criteria, $con);
}
} else {
// criteria has no effect for a new object
if (!$this->isNew()) {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(sfGuardUserGroupPeer::USER_ID, $this->id);
sfGuardUserGroupPeer::addSelectColumns($criteria);
if (!isset($this->lastsfGuardUserGroupCriteria) || !$this->lastsfGuardUserGroupCriteria->equals($criteria)) {
$this->collsfGuardUserGroups = sfGuardUserGroupPeer::doSelect($criteria, $con);
}
}
}
$this->lastsfGuardUserGroupCriteria = $criteria;
return $this->collsfGuardUserGroups;
}
示例2: getsfGuardUserGroups
public function getsfGuardUserGroups($criteria = null, $con = null)
{
include_once 'plugins/sfGuardPlugin/lib/model/om/BasesfGuardUserGroupPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
if ($this->collsfGuardUserGroups === null) {
if ($this->isNew()) {
$this->collsfGuardUserGroups = array();
} else {
$criteria->add(sfGuardUserGroupPeer::USER_ID, $this->getId());
sfGuardUserGroupPeer::addSelectColumns($criteria);
$this->collsfGuardUserGroups = sfGuardUserGroupPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(sfGuardUserGroupPeer::USER_ID, $this->getId());
sfGuardUserGroupPeer::addSelectColumns($criteria);
if (!isset($this->lastsfGuardUserGroupCriteria) || !$this->lastsfGuardUserGroupCriteria->equals($criteria)) {
$this->collsfGuardUserGroups = sfGuardUserGroupPeer::doSelect($criteria, $con);
}
}
}
$this->lastsfGuardUserGroupCriteria = $criteria;
return $this->collsfGuardUserGroups;
}
示例3: retrieveByPK
/**
* Retrieve object using using composite pkey values.
* @param string $user_id
* @param int $group_id
* @param PropelPDO $con
* @return sfGuardUserGroup
*/
public static function retrieveByPK($user_id, $group_id, PropelPDO $con = null)
{
$key = serialize(array((string) $user_id, (string) $group_id));
if (null !== ($obj = sfGuardUserGroupPeer::getInstanceFromPool($key))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(sfGuardUserGroupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(sfGuardUserGroupPeer::DATABASE_NAME);
$criteria->add(sfGuardUserGroupPeer::USER_ID, $user_id);
$criteria->add(sfGuardUserGroupPeer::GROUP_ID, $group_id);
$v = sfGuardUserGroupPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
示例4: retrieveByPK
public static function retrieveByPK($user_id, $group_id, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(sfGuardUserGroupPeer::USER_ID, $user_id);
$criteria->add(sfGuardUserGroupPeer::GROUP_ID, $group_id);
$v = sfGuardUserGroupPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}