/** @return UsersToBeImportedCollection */
 public function buildFromArchive(ArchiveInterface $archive)
 {
     $xml_contents = $archive->getUsersXML();
     if (!$xml_contents) {
         throw new UsersXMLNotFoundException();
     }
     $xml_element = $this->security->loadString($xml_contents);
     $rng_path = realpath(__DIR__ . '/../../../xml/resources/users.rng');
     $this->xml_validator->validate($xml_element, $rng_path);
     return $this->build($xml_element);
 }
Ejemplo n.º 2
0
 private function getProjectXMLFromArchive(ArchiveInterface $archive)
 {
     $xml_contents = $archive->getProjectXML();
     if (!$xml_contents) {
         throw new RuntimeException('No content available in archive for file ' . ArchiveInterface::PROJECT_FILE);
     }
     return $this->getSimpleXMLElementFromString($xml_contents);
 }