public static function fromDbArray($arr)
 {
     $newArr = new KalturaAccessControlArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaAccessControl();
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaAccessControlArray();
     if ($arr == null) {
         return $newArr;
     }
     foreach ($arr as $obj) {
         $nObj = new KalturaAccessControl();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 function update($id, KalturaAccessControl $accessControl)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "accessControl", $accessControl->toParams());
     $this->client->queueServiceActionCall("accesscontrol", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaAccessControl");
     return $resultObject;
 }
 /**
  * Update Access Control Profile by id
  * 
  * @action update
  * @param int $id
  * @param KalturaAccessControl $accessControl
  * @return KalturaAccessControl
  */
 function updateAction($id, KalturaAccessControl $accessControl)
 {
     $dbAccessControl = accessControlPeer::retrieveByPK($id);
     if (!$dbAccessControl) {
         throw new KalturaAPIException(KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND, $id);
     }
     if ($accessControl->name !== null) {
         $accessControl->validatePropertyMinLength("name", 1);
     }
     $accessControl->toUpdatableObject($dbAccessControl);
     $dbAccessControl->save();
     $accessControl = new KalturaAccessControl();
     $accessControl->fromObject($dbAccessControl);
     return $accessControl;
 }
 /**
  * Update Access Control Profile by id
  * 
  * @action update
  * @param int $id
  * @param KalturaAccessControl $accessControl
  * @return KalturaAccessControl
  * 
  * @throws KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND
  * @throws KalturaErrors::ACCESS_CONTROL_NEW_VERSION_UPDATE
  */
 function updateAction($id, KalturaAccessControl $accessControl)
 {
     $dbAccessControl = accessControlPeer::retrieveByPK($id);
     if (!$dbAccessControl) {
         throw new KalturaAPIException(KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND, $id);
     }
     $rules = $dbAccessControl->getRulesArray();
     foreach ($rules as $rule) {
         if (!$rule instanceof kAccessControlRestriction) {
             throw new KalturaAPIException(KalturaErrors::ACCESS_CONTROL_NEW_VERSION_UPDATE, $id);
         }
     }
     $accessControl->validatePropertyMinLength("name", 1, true);
     $accessControl->toUpdatableObject($dbAccessControl);
     $dbAccessControl->save();
     $accessControl = new KalturaAccessControl();
     $accessControl->fromObject($dbAccessControl);
     return $accessControl;
 }