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


PHP PartnerPeer::retrieveByPk方法代码示例

本文整理汇总了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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:21,代码来源:BaseLiveChannelSegment.php

示例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
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:01_create_base_admin_console_roles_and_migrate_users.php


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