setName($name); } if ($file !== null) { $this->setFile($file); } if ($url !== null) { $this->setUrl($url); } } /** * Set the Name of the Script * * @param string $name Script Name * @return \FML\ManiaCode\InstallScript */ public function setName($name) { $this->name = (string) $name; return $this; } /** * Set the File of the Script * * @param string $file Script File * @return \FML\ManiaCode\InstallScript */ public function setFile($file) { $this->file = (string) $file; return $this; } /** * Set the Url of the Script * * @param string $url Script Url * @return \FML\ManiaCode\InstallScript */ public function setUrl($url) { $this->url = (string) $url; return $this; } /** * * @see \FML\ManiaCode\Element::render() */ public function render(\DOMDocument $domDocument) { $xmlElement = $domDocument->createElement($this->tagName); $nameElement = $domDocument->createElement('name', $this->name); $xmlElement->appendChild($nameElement); $fileElement = $domDocument->createElement('file', $this->file); $xmlElement->appendChild($fileElement); $urlElement = $domDocument->createElement('url', $this->url); $xmlElement->appendChild($urlElement); return $xmlElement; } }