Get content key authorization policy.

@param ContentKeyAuthorizationPolicy|string $contentKeyAuthorizationPolicy ContentKeyAuthorizationPolicies data
or content key authorization policy Id

@return ContentKeyAuthorizationPolicy
358778
public function getContentKeyAuthorizationPolicy($contentKeyAuthorizationPolicy)
    {
        $contentKeyAuthorizationPolicyId = Utilities::getEntityId(
            $contentKeyAuthorizationPolicy,
            'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy'
        );

        return ContentKeyAuthorizationPolicy::createFromOptions(
            $this->_getEntity("ContentKeyAuthorizationPolicies('{$contentKeyAuthorizationPolicyId}')")
        );
    }
622964
public function getAuthorizationHeader()
    {
        if (!is_null($this->bearerKey)) {
            return 'Bearer ' . $this->bearerKey;
        }

        return 'ApiKey ' . $this->username . ':' . $this->apiKey;
    }
477707
public function get(string $oid): PolicyInformation
    {
        if (!$this->has($oid)) {
            throw new \LogicException("Not certificate policy by OID $oid.");
        }
        return $this->_policies[$oid];
    }
211835
public function mapContentById($contentId)
    {
        $contentInfo = $this->contentHandler->loadContentInfo($contentId);

        return $this->mapContent(
            $this->contentHandler->load($contentId, $contentInfo->currentVersionNo)
        );
    }
1316415
public function getRolesByContentTypePermission($permissionName, $contenttype)
    {
        // Here's how it works:
        // - if a permission is granted through 'contenttype-all', it is effectively granted
        // - if a permission is granted through 'contenttypes/$contenttype', it is effectively granted
        // - if 'contenttypes/$contenttype/$permissionName' is not set, *and* the permission is granted through 'contenttype-default', it is effectively granted
        // - otherwise, the permission is denied
        $overrideRoles = $this->app['config']->get("permissions/contenttype-all/$permissionName");
        if (!is_array($overrideRoles)) {
            $overrideRoles = [];
        }
        $contenttypeRoles = $this->app['config']->get("permissions/contenttypes/$contenttype/$permissionName");
        if (!is_array($contenttypeRoles)) {
            $contenttypeRoles = $this->app['config']->get("permissions/contenttype-default/$permissionName");
        }
        if (!is_array($contenttypeRoles)) {
            $contenttypeRoles = [];
        }
        $effectiveRoles = array_unique(array_merge($overrideRoles, $contenttypeRoles));

        return $effectiveRoles;
    }
192286
public function getContentKeyAuthorizationPolicyLinkedOptions($policy)
    {
        $policyId = Utilities::getEntityId(
            $policy,
            'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy'
        );

        $propertyList = $this->_getEntityList("ContentKeyAuthorizationPolicies('{$policyId}')/Options");
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = ContentKeyAuthorizationPolicyOption::createFromOptions($properties);
        }

        return $result;
    }
697931
public function get($url, $access_token = null, $parameters = [], $contentType = 'text/xml')
    {
        return $this->doApiCall($url, 'GET', $access_token, $parameters, $contentType);
    }
1249423
public static function fetchByContentObjectID( $contentObjectID, $asObject = true, $contentObjectVersion = false )
    {
        $conds = array( 'contentobject_id' => $contentObjectID );
        if ( $contentObjectVersion !== false )
        {
            $conds['contentobject_version'] = $contentObjectVersion;
        }

        return self::fetchObject(
            self::definition(),
            null,
            $conds,
            $asObject
        );
    }
1093940
public function getAuthorizer(string $appId)
    {
        $params = [
            'component_appid' => $this->app['config']['app_id'],
            'authorizer_appid' => $appId,
        ];

        return $this->httpPostJson('cgi-bin/component/api_get_authorizer_info', $params);
    }
1330449
public function getAuthKeyVar($key)
    {
        if (!isset($this->authKeyMap[$key])) {
            $msg = 'Invalid Auth key requested: ' . $key;
            throw new ApiException($msg);
        }

        $property = $this->authKeyMap[$key];
        return $this->$property;
    }
622648
public function getRelated($contentType = null)
    {
        if ($contentType !== null) {
            return $this->getRelation($contentType);
        }

        return $this->getRelation()->all();
    }
359990
public function getParentContentUidByUid($contentUid)
    {
        $q = $this->_em->getConnection()
                ->createQueryBuilder()
                ->select('c.parent_uid')
                ->from('content_has_subcontent', 'c')
                ->where('c.content_uid = :uid')
                ->setParameter('uid', $contentUid);

        return $q->execute()->fetchAll(\PDO::FETCH_COLUMN);
    }
162922
protected function extractKeywordsFromContentType(ContentTypeInterface $contentType)
    {
        $keywordIds = array();
        $fields = $contentType->getFields();

        foreach ($fields as $field) {
            $fieldOptions = $field->getOptions();
            foreach ($fieldOptions as $option) {
                if ($this->isKeywordsConditionAttribute($option->getValue())) {
                    $keywordIds = array_merge(
                        $keywordIds,
                        $this->extractKeywordIdsFromConditionAttribute($option->getValue())
                    );
                }
            }
        }

        return $keywordIds;
    }
190883
final protected function _getPasswordPolicyDescription($policyType){
        $policyObj = $this->_getUdfPasswordPolicy();

        switch ($policyType) {
            case 'illegal_attempts_limit':
                if ($policyObj['illegal_attempts_limit'] > 0) {
                    return 'The illegal login attempts limit is '.$policyObj['illegal_attempts_limit'];
                }
            break;
            case 'password_reset_frequency':
                if ($policyObj['password_reset_frequency'] > 0) {
                    return 'The password reset frequency is '.$policyObj['password_reset_frequency'].' days';
                }
            break;
            case 'password_repeat_minimum':
                if ($policyObj['password_repeat_minimum'] > 0) {
                    return 'A user is not allowed to repeat any of their last '.$policyObj['password_repeat_minimum'].' passwords';
                }
            break;
            case 'illegal_attempts_penalty_seconds':
                if ($policyObj['illegal_attempts_penalty_seconds'] > 0) {
                    return 'A user account will be temporarily locked out after the illegal login attempts limit for '.$policyObj['illegal_attempts_penalty_seconds'].' seconds; and will require admin intervention if the offense is repeated';
                }
            break;
            default:
            
            break;
        }
    }
1289585
public function getConfig($contentType)
    {
        if (array_key_exists($contentType, $this->searchableTypes)) {
            return $this->searchableTypes[$contentType];
        }

        if ($this->canSearchInvisible() && array_key_exists($contentType, $this->invisibleTypes)) {
            return $this->invisibleTypes[$contentType];
        }

        return false;
    }
320757
protected function resolveType($contentType)
    {
        $mapped = $this->getMimeType($contentType);
        if ($mapped) {
            return is_array($mapped) ? current($mapped) : $mapped;
        }
        if (strpos($contentType, '/') === false) {
            throw new InvalidArgumentException(sprintf('"%s" is an invalid content type.', $contentType));
        }

        return $contentType;
    }
778415
private function getContentIdentifier($contentId)
    {
        $contentType = $this->contentTypeService->loadContentType(
            $this->contentService
                ->loadContent($contentId)
                ->contentInfo
                ->contentTypeId
        );

        return $contentType->identifier;
    }