/** * Update access control profile by id * * @action update * @param int $id * @param KalturaAccessControlProfile $accessControlProfile * @return KalturaAccessControlProfile * * @throws KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND */ function updateAction($id, KalturaAccessControlProfile $accessControlProfile) { $dbAccessControl = accessControlPeer::retrieveByPK($id); if (!$dbAccessControl) { throw new KalturaAPIException(KalturaErrors::ACCESS_CONTROL_ID_NOT_FOUND, $id); } $accessControlProfile->toUpdatableObject($dbAccessControl); $dbAccessControl->save(); $accessControlProfile = new KalturaAccessControlProfile(); $accessControlProfile->fromObject($dbAccessControl); return $accessControlProfile; }
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null) { $newArr = new KalturaAccessControlProfileArray(); if ($arr == null) { return $newArr; } foreach ($arr as $obj) { $nObj = new KalturaAccessControlProfile(); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }