本文整理汇总了PHP中PartnerPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP PartnerPeer::retrieveByPk方法的具体用法?PHP PartnerPeer::retrieveByPk怎么用?PHP PartnerPeer::retrieveByPk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartnerPeer
的用法示例。
在下文中一共展示了PartnerPeer::retrieveByPk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPartner
/**
* Get the associated Partner object
*
* @param PropelPDO Optional Connection object.
* @return Partner The associated Partner object.
* @throws PropelException
*/
public function getPartner(PropelPDO $con = null)
{
if ($this->aPartner === null && $this->partner_id !== null) {
$this->aPartner = PartnerPeer::retrieveByPk($this->partner_id);
/* 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->aPartner->addLiveChannelSegments($this);
*/
}
return $this->aPartner;
}
示例2: foreach
$permissions = 'SYSTEM_ADMIN_BASE';
$role->setPermissionNames($permissions);
$role->setStatus(UserRoleStatus::ACTIVE);
$role->setTags('admin_console');
$userRoles['guest'] = $role;
//------------------------------------------------------
foreach ($userRoles as $key => $newRole) {
$newRole->setPartnerId(-2);
// set admin console partner id (-2)
if ($dryRun) {
KalturaLog::log('DRY RUN - Adding new role - ' . print_r($newRole, true));
} else {
KalturaLog::log('Adding new role - ' . print_r($newRole, true));
$newRole->save();
if ($key === 'admin') {
$partner = PartnerPeer::retrieveByPk(-2);
$partner->setAdminSessionRoleId($newRole->getId());
$partner->save();
}
}
}
//------------------------------------------------------
// get users
$c = new Criteria();
$c->addAscendingOrderByColumn(kuserPeer::ID);
$c->addAnd(kuserPeer::PARTNER_ID, ADMIN_CONSOLE_PARTNER_ID, Criteria::EQUAL);
kuserPeer::clearInstancePool();
kuserPeer::setUseCriteriaFilter(false);
$users = kuserPeer::doSelect($c);
kuserPeer::setUseCriteriaFilter(true);
// set relevant role to each user