private static function resolveManifestToXml($manifest) { if (is_array($manifest)) { $xmlstring = Xml::fromProperties($manifest)->asXML(); } elseif ($manifest instanceof Manifest) { $xmlstring = Xml::fromManifest($manifest)->asXML(); } elseif (is_string($manifest)) { $xmlstring = $manifest; } else { $message = sprintf('Manifest must be an array of properties, and instance of %s, or an XML string.', 'Cpapdotcom\\Asendia\\Manifest\\Manifest'); throw new InvalidArgumentException($message); } return $xmlstring; }
/** * @param array $properties * @param string $rootElementName * * @return \SimpleXMLElement */ public static function createXmlFromProperties(array $properties, $rootElementName = 'BwwManifest') { return Manifest\Xml::fromProperties($properties, $rootElementName); }