Back to LibraryManifest class

Method loadManifestFromData

protected void
loadManifestFromData
(\SimpleXMLElement $xml)
Apply manifest data from a \SimpleXMLElement to the object.
Parameters
  • \SimpleXMLElement $xml Data to load
Returns
  • void
Since
  • 3.1

Method loadManifestFromData - Source code

/**
 * Apply manifest data from a \SimpleXMLElement to the object.
 *
 * @param   \SimpleXMLElement  $xml  Data to load
 *
 * @return  void
 *
 * @since   3.1
 */
protected function loadManifestFromData(\SimpleXMLElement $xml)
{
    $this->name = (string) $xml->name;
    $this->libraryname = (string) $xml->libraryname;
    $this->version = (string) $xml->version;
    $this->description = (string) $xml->description;
    $this->creationdate = (string) $xml->creationDate;
    $this->author = (string) $xml->author;
    $this->authoremail = (string) $xml->authorEmail;
    $this->authorurl = (string) $xml->authorUrl;
    $this->packager = (string) $xml->packager;
    $this->packagerurl = (string) $xml->packagerurl;
    $this->update = (string) $xml->update;
    if (isset($xml->files) && isset($xml->files->file) && \count($xml->files->file)) {
        foreach ($xml->files->file as $file) {
            $this->filelist[] = (string) $file;
        }
    }
}