示例#1
0
 private static function createDefaultAccessControl($partnerId, $defaultPolicy)
 {
     $accessControlProfile = new accessControl();
     $accessControlProfile->setDescription('DRM default access control');
     $accessControlProfile->setName('drm_default_' . $partnerId);
     $accessControlProfile->setPartnerId($partnerId);
     $accessControlProfile->setSystemName('drm_default_' . $partnerId);
     $ruleDefault = self::addAccessControlRule($defaultPolicy->getId());
     $accessControlProfile->setRulesArray(array($ruleDefault));
     $accessControlProfile->save();
     KalturaLog::debug("Access control profile id:" . $accessControlProfile->getId());
 }
示例#2
0
 private static function createDefaultAccessControl($partnerId, $defaultPolicy, $rentalPolicy, $purchasePolicy, $subscriptionPolicy)
 {
     $accessControlProfile = new accessControl();
     $accessControlProfile->setDescription('Play Ready default access control');
     $accessControlProfile->setName('play_ready_default_' . $partnerId);
     $accessControlProfile->setPartnerId($partnerId);
     $accessControlProfile->setSystemName('play_ready_default_' . $partnerId);
     $rulePurchase = self::addAccessControlRule('scenario_purchase', $purchasePolicy->getId());
     $ruleRental = self::addAccessControlRule('scenario_rental', $rentalPolicy->getId());
     $ruleDefault = self::addAccessControlRule('scenario_default', $defaultPolicy->getId());
     $ruleSubscription = self::addAccessControlRule('scenario_subscription', $subscriptionPolicy->getId());
     $accessControlProfile->setRulesArray(array($rulePurchase, $ruleRental, $ruleDefault, $ruleSubscription));
     $accessControlProfile->save();
     KalturaLog::debug("Access control profile id:" . $accessControlProfile->getId());
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      accessControl $value A accessControl object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(accessControl $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
示例#4
0
 /**
  * Declares an association between this object and a accessControl object.
  *
  * @param      accessControl $v
  * @return     entry The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setaccessControl(accessControl $v = null)
 {
     if ($v === null) {
         $this->setAccessControlId(NULL);
     } else {
         $this->setAccessControlId($v->getId());
     }
     $this->aaccessControl = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the accessControl object, it will not be re-added.
     if ($v !== null) {
         $v->addentry($this);
     }
     return $this;
 }
示例#5
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      accessControl $value A accessControl object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(accessControl $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         if (isset(self::$instances[$key]) || count(self::$instances) < kConf::get('max_num_instances_in_pool')) {
             self::$instances[$key] = $obj;
             kMemoryManager::registerPeer('accessControlPeer');
         }
     }
 }