private function checkMetadataPrefix($metadataPrefix, $identifier = null)
    {
        $availableMetadataFormats = $this->repository->listMetadataFormats($identifier);

        $found = false;
        if (!empty($availableMetadataFormats)) {
            foreach ($availableMetadataFormats as $metadataFormat) {
                if ($metadataPrefix == $metadataFormat->getPrefix()) {
                    $found = true;
                    break;
                }
            }
        }

        if (!$found) {
            throw new CannotDisseminateFormatException(
                'The metadata format identified by the value given for the metadataPrefix argument '
                . 'is not supported by the item or by the repository.'
            );
        }
    }
private function checkMetadataPrefix($metadataPrefix, $identifier = null)
    {
        $availableMetadataFormats = $this->repository->listMetadataFormats($identifier);

        $found = false;
        if (!empty($availableMetadataFormats)) {
            foreach ($availableMetadataFormats as $metadataFormat) {
                if ($metadataPrefix == $metadataFormat->getPrefix()) {
                    $found = true;
                    break;
                }
            }
        }

        if (!$found) {
            throw new CannotDisseminateFormatException(
                'The metadata format identified by the value given for the metadataPrefix argument '
                . 'is not supported by the item or by the repository.'
            );
        }
    }
private function checkMetadataPrefix ( $ metadataPrefix , $ identifier = null ) { $ availableMetadataFormats = $ this -> repository -> listMetadataFormats ( $ identifier ) ; $ found = false ; if ( ! empty ( $ availableMetadataFormats ) ) { foreach ( $ availableMetadataFormats as $ metadataFormat ) { if ( $ metadataPrefix == $ metadataFormat -> getPrefix ( ) ) { $ found = true ; break ; } } } if ( ! $ found ) { throw new CannotDisseminateFormatException ( 'The metadata format identified by the value given for the metadataPrefix argument ' . 'is not supported by the item or by the repository.' ) ; } }
Checks if the metadata prefix is in the available metadata formats list.
@param string $metadataPrefix
@param string $identifier , optional argument that specifies the unique identifier of an item
@throws CannotDisseminateFormatException
Checks if the metadata prefix is in the available metadata formats list .