Skip to content
Snippets Groups Projects
Commit d3532994 authored by Olav Morken's avatar Olav Morken
Browse files

MetadataStorageHandler: Add function to retrieve metadata as configuration object.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1601 44740490-163a-0410-bde0-09ae8108e29a
parent 67f35d2e
No related branches found
No related tags found
No related merge requests found
...@@ -316,6 +316,24 @@ class SimpleSAML_Metadata_MetaDataStorageHandler { ...@@ -316,6 +316,24 @@ class SimpleSAML_Metadata_MetaDataStorageHandler {
throw new Exception('Unable to locate metadata for \'' . $index . '\' in set \'' . $set . '\'.'); throw new Exception('Unable to locate metadata for \'' . $index . '\' in set \'' . $set . '\'.');
} }
/**
* Retrieve the metadata as a configuration object.
*
* This function will throw an exception if it is unable to locate the metadata.
*
* @param string $entityId The entity ID we are looking up.
* @param string $set The metadata set we are searching.
* @return SimpleSAML_Configuration The configuration object representing the metadata.
*/
public function getMetaDataConfig($entityId, $set) {
assert('is_string($entityId)');
assert('is_string($set)');
$metadata = $this->getMetaData($entityId, $set);
return SimpleSAML_Configuration::loadFromArray($metadata, $set . '/' . var_export($entityId, TRUE));
}
} }
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment