FML Update
This commit is contained in:
@ -3,58 +3,56 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element adding a Buddy
|
||||
* ManiaCode Element adding a buddy
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class AddBuddy implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'add_buddy';
|
||||
protected $login = '';
|
||||
protected $login = null;
|
||||
|
||||
/**
|
||||
* Construct a new AddBuddy Element
|
||||
* Create a new AddBuddy Element
|
||||
*
|
||||
* @param string $login (optional) Buddy Login
|
||||
* @return \FML\ManiaCode\AddBuddy
|
||||
* @param string $login (optional) Buddy login
|
||||
* @return \FML\ManiaCode\AddBuddy|static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$addBuddy = new AddBuddy($login);
|
||||
return $addBuddy;
|
||||
return new static($login);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new AddBuddy Element
|
||||
*
|
||||
* @param string $login (optional) Buddy Login
|
||||
* @param string $login (optional) Buddy login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
if (!is_null($login)) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Buddy Login
|
||||
* Set the buddy login
|
||||
*
|
||||
* @param string $login Buddy Login
|
||||
* @return \FML\ManiaCode\AddBuddy
|
||||
* @param string $login Buddy login
|
||||
* @return \FML\ManiaCode\AddBuddy|static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string) $login;
|
||||
$this->login = (string)$login;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
return $xmlElement;
|
||||
|
@ -3,82 +3,79 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element adding a Server as Favorite
|
||||
* ManiaCode Element adding a server as favorite
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class AddFavorite implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'add_favourite';
|
||||
protected $login = '';
|
||||
protected $ip = null;
|
||||
protected $port = null;
|
||||
protected $login = null;
|
||||
protected $serverIp = null;
|
||||
protected $serverPort = null;
|
||||
|
||||
/**
|
||||
* Construct a new AddFavorite Element
|
||||
* Create a new AddFavorite object
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
* @param string $login (optional) Server login
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$addFavorite = new AddFavorite($login);
|
||||
return $addFavorite;
|
||||
return new static($login);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new AddFavorite Element
|
||||
* Construct a new AddFavorite object
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @param string $login (optional) Server login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
if (!is_null($login)) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Login
|
||||
* Set the server login
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
* @param string $login Server login
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string) $login;
|
||||
$this->ip = null;
|
||||
$this->port = null;
|
||||
$this->login = (string)$login;
|
||||
$this->serverIp = null;
|
||||
$this->serverPort = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Ip and Port
|
||||
* Set the server ip and port
|
||||
*
|
||||
* @param string $ip Server Ip
|
||||
* @param int $port Server Port
|
||||
* @return \FML\ManiaCode\AddFavorite
|
||||
* @param string $serverIp Server ip
|
||||
* @param int $serverPort Server port
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
*/
|
||||
public function setIp($ip, $port) {
|
||||
$this->ip = (string) $ip;
|
||||
$this->port = (int) $port;
|
||||
$this->login = null;
|
||||
public function setIp($serverIp, $serverPort) {
|
||||
$this->serverIp = (string)$serverIp;
|
||||
$this->serverPort = (int)$serverPort;
|
||||
$this->login = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->ip === null) {
|
||||
if (is_null($this->serverIp)) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
}
|
||||
else {
|
||||
$ipElement = $domDocument->createElement('ip', $this->ip . ':' . $this->port);
|
||||
} else {
|
||||
$ipElement = $domDocument->createElement('ip', $this->serverIp . ':' . $this->serverPort);
|
||||
$xmlElement->appendChild($ipElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
|
@ -5,16 +5,16 @@ namespace FML\ManiaCode;
|
||||
/**
|
||||
* Base ManiaCode Element
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
interface Element {
|
||||
|
||||
/**
|
||||
* Render the ManiaCode Element
|
||||
*
|
||||
* @param \DOMDocument $domDocument The DomDocument for which the Element should be rendered
|
||||
* @param \DOMDocument $domDocument The DOMDocument for which the Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument);
|
||||
|
@ -3,92 +3,90 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element downloading a Skin
|
||||
* ManiaCode Element downloading a skin
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class GetSkin implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'get_skin';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $file = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new GetSkin Element
|
||||
* Create a new GetSkin object
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$getSkin = new GetSkin($name, $file, $url);
|
||||
return $getSkin;
|
||||
return new static($name, $file, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new GetSkin Element
|
||||
* Construct a new GetSkin object
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
if (!is_null($file)) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Skin
|
||||
* Set the name of the skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
* @param string $name Skin name
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
$this->name = (string)$name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Skin
|
||||
* Set the file of the skin
|
||||
*
|
||||
* @param string $file Skin File
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
* @param string $file Skin file
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
$this->file = (string)$file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Skin
|
||||
* Set the url of the skin
|
||||
*
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode\GetSkin
|
||||
* @param string $url Skin url
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
$this->url = (string)$url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -3,58 +3,56 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element going to a Link
|
||||
* ManiaCode Element for going to a link
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Go_To implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'goto';
|
||||
protected $link = '';
|
||||
protected $link = null;
|
||||
|
||||
/**
|
||||
* Create a new Go_To Element
|
||||
* Create a new Go_To object
|
||||
*
|
||||
* @param string $link (optional) Goto Link
|
||||
* @return \FML\ManiaCode\Go_To
|
||||
* @param string $link (optional) Goto link
|
||||
* @return \FML\ManiaCode\Go_To|static
|
||||
*/
|
||||
public static function create($link = null) {
|
||||
$goTo = new Go_To($link);
|
||||
return $goTo;
|
||||
return new static($link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new Go_To Element
|
||||
* Construct a new Go_To object
|
||||
*
|
||||
* @param string $link (optional) Goto Link
|
||||
* @param string $link (optional) Goto link
|
||||
*/
|
||||
public function __construct($link = null) {
|
||||
if ($link !== null) {
|
||||
if (!is_null($link)) {
|
||||
$this->setLink($link);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Goto Link
|
||||
* Set link
|
||||
*
|
||||
* @param string $link Goto Link
|
||||
* @return \FML\ManiaCode\Go_To
|
||||
* @param string $link Goto link
|
||||
* @return \FML\ManiaCode\Go_To|static
|
||||
*/
|
||||
public function setLink($link) {
|
||||
$this->link = (string) $link;
|
||||
$this->link = (string)$link;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$linkElement = $domDocument->createElement('link', $this->link);
|
||||
$xmlElement->appendChild($linkElement);
|
||||
return $xmlElement;
|
||||
|
@ -3,91 +3,89 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Macroblock
|
||||
* ManiaCode Element installing a macroblock
|
||||
*
|
||||
* @author steeffeen
|
||||
* @author steeffeen
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallMacroblock implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_macroblock';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $file = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallMacroblock Element
|
||||
* Create a new InstallMacroblock object
|
||||
*
|
||||
* @param string $name (optional) Macroblock Name
|
||||
* @param string $url (optional) Macroblock Url
|
||||
* @return \FML\ManiaCode\InstallMacroblock
|
||||
* @param string $name (optional) Macroblock name
|
||||
* @param string $url (optional) Macroblock url
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$installMacroblock = new InstallMacroblock($name, $url);
|
||||
return $installMacroblock;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallMacroblock Element
|
||||
* Construct a new InstallMacroblock object
|
||||
*
|
||||
* @param string $name (optional) Macroblock Name
|
||||
* @param string $file (optional) Macroblock File
|
||||
* @param string $url (optional) Macroblock Url
|
||||
* @param string $name (optional) Macroblock name
|
||||
* @param string $file (optional) Macroblock file
|
||||
* @param string $url (optional) Macroblock url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
if (!is_null($file)) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Macroblock
|
||||
* Set the name of the macroblock
|
||||
*
|
||||
* @param string $name Macroblock Name
|
||||
* @return \FML\ManiaCode\InstallMacroblock
|
||||
* @param string $name Macroblock name
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string) $name;
|
||||
$this->name = (string)$name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Macroblock
|
||||
* Set the file of the macroblock
|
||||
*
|
||||
* @param string $file Macroblock File
|
||||
* @return \FML\ManiaCode\InstallMacroblock
|
||||
* @param string $file Macroblock file
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string) $file;
|
||||
$this->file = (string)$file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Macroblock
|
||||
* Set the url of the macroblock
|
||||
*
|
||||
* @param string $url Macroblock Url
|
||||
* @return \FML\ManiaCode\InstallMacroblock
|
||||
* @param string $url Macroblock url
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string) $url;
|
||||
$this->url = (string)$url;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Map
|
||||
* ManiaCode Element installing a map
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,44 +11,43 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class InstallMap implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_map';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallMap Element
|
||||
* Create a new InstallMap object
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$installMap = new InstallMap($name, $url);
|
||||
return $installMap;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallMap Element
|
||||
* Construct a new InstallMap object
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Map
|
||||
* Set the name of the map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
* @param string $name Map name
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -56,10 +55,10 @@ class InstallMap implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Map
|
||||
* Set the url of the map
|
||||
*
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode\InstallMap
|
||||
* @param string $url Map url
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Title Pack
|
||||
* ManiaCode Element installing a title pack
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,50 +11,49 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class InstallPack implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_pack';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $file = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallPack Element
|
||||
* Create a new InstallPack object
|
||||
*
|
||||
* @param string $name (optional) Pack Name
|
||||
* @param string $file (optional) Pack File
|
||||
* @param string $url (optional) Pack Url
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
* @param string $name (optional) Pack name
|
||||
* @param string $file (optional) Pack file
|
||||
* @param string $url (optional) Pack url
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installPack = new InstallPack($name, $file, $url);
|
||||
return $installPack;
|
||||
return new static($name, $file, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallPack Element
|
||||
* Construct a new InstallPack object
|
||||
*
|
||||
* @param string $name (optional) Pack Name
|
||||
* @param string $file (optional) Pack File
|
||||
* @param string $url (optional) Pack Url
|
||||
* @param string $name (optional) Pack name
|
||||
* @param string $file (optional) Pack file
|
||||
* @param string $url (optional) Pack url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
if (!is_null($file)) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Pack
|
||||
* Set the name of the pack
|
||||
*
|
||||
* @param string $name Pack Name
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
* @param string $name Pack name
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -62,10 +61,10 @@ class InstallPack implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Pack
|
||||
* Set the file of the pack
|
||||
*
|
||||
* @param string $file Pack File
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
* @param string $file Pack file
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -73,10 +72,10 @@ class InstallPack implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Pack
|
||||
* Set the url of the pack
|
||||
*
|
||||
* @param string $url Pack Url
|
||||
* @return \FML\ManiaCode\InstallPack
|
||||
* @param string $url Pack url
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Replay
|
||||
* ManiaCode Element installing a replay
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,44 +11,43 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class InstallReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallReplay Element
|
||||
* Create a new InstallReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$installReplay = new InstallReplay($name, $url);
|
||||
return $installReplay;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallReplay Element
|
||||
* Construct a new InstallReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -56,10 +55,10 @@ class InstallReplay implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\InstallReplay
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Script
|
||||
* ManiaCode Element installing a script
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,50 +11,49 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class InstallScript implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_script';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $file = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallScript Element
|
||||
* Create a new InstallScript object
|
||||
*
|
||||
* @param string $name (optional) Script Name
|
||||
* @param string $file (optional) Script File
|
||||
* @param string $url (optional) Script Url
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
* @param string $name (optional) Script name
|
||||
* @param string $file (optional) Script file
|
||||
* @param string $url (optional) Script url
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installScript = new InstallScript($name, $file, $url);
|
||||
return $installScript;
|
||||
return new static($name, $file, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallScript Element
|
||||
* Construct a new InstallScript object
|
||||
*
|
||||
* @param string $name (optional) Script Name
|
||||
* @param string $file (optional) Script File
|
||||
* @param string $url (optional) Script Url
|
||||
* @param string $name (optional) Script name
|
||||
* @param string $file (optional) Script file
|
||||
* @param string $url (optional) Script url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
if (!is_null($file)) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Script
|
||||
* Set the name of the script
|
||||
*
|
||||
* @param string $name Script Name
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
* @param string $name Script name
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -62,10 +61,10 @@ class InstallScript implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Script
|
||||
* Set the file of the script
|
||||
*
|
||||
* @param string $file Script File
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
* @param string $file Script file
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -73,10 +72,10 @@ class InstallScript implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Script
|
||||
* Set the url of the script
|
||||
*
|
||||
* @param string $url Script Url
|
||||
* @return \FML\ManiaCode\InstallScript
|
||||
* @param string $url Script url
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element installing a Skin
|
||||
* ManiaCode Element installing a skin
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,50 +11,49 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class InstallSkin implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'install_skin';
|
||||
protected $name = '';
|
||||
protected $file = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $file = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new InstallSkin Element
|
||||
* Create a new InstallSkin object
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
$installSkin = new InstallSkin($name, $file, $url);
|
||||
return $installSkin;
|
||||
return new static($name, $file, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new InstallSkin Element
|
||||
* Construct a new InstallSkin object
|
||||
*
|
||||
* @param string $name (optional) Skin Name
|
||||
* @param string $file (optional) Skin File
|
||||
* @param string $url (optional) Skin Url
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
*/
|
||||
public function __construct($name = null, $file = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($file !== null) {
|
||||
if (!is_null($file)) {
|
||||
$this->setFile($file);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Skin
|
||||
* Set the name of the skin
|
||||
*
|
||||
* @param string $name Skin Name
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
* @param string $name Skin name
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -62,10 +61,10 @@ class InstallSkin implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the File of the Skin
|
||||
* Set the file of the skin
|
||||
*
|
||||
* @param string $file Skin File
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
* @param string $file Skin file
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -73,10 +72,10 @@ class InstallSkin implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Skin
|
||||
* Set the url of the skin
|
||||
*
|
||||
* @param string $url Skin Url
|
||||
* @return \FML\ManiaCode\InstallSkin
|
||||
* @param string $url Skin url
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element joining a Server
|
||||
* ManiaCode Element for joining a server
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,59 +11,58 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class JoinServer implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'join_server';
|
||||
protected $login = '';
|
||||
protected $ip = null;
|
||||
protected $port = null;
|
||||
protected $login = null;
|
||||
protected $serverIp = null;
|
||||
protected $serverPort = null;
|
||||
|
||||
/**
|
||||
* Create a new JoinServer Element
|
||||
* Create a new JoinServer object
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
* @param string $login (optional) Server login
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
$joinServer = new JoinServer($login);
|
||||
return $joinServer;
|
||||
return new static($login);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new JoinServer Element
|
||||
* Construct a new JoinServer object
|
||||
*
|
||||
* @param string $login (optional) Server Login
|
||||
* @param string $login (optional) Server login
|
||||
*/
|
||||
public function __construct($login = null) {
|
||||
if ($login !== null) {
|
||||
if (!is_null($login)) {
|
||||
$this->setLogin($login);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Login
|
||||
* Set the server login
|
||||
*
|
||||
* @param string $login Server Login
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
* @param string $login Server login
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string)$login;
|
||||
$this->ip = null;
|
||||
$this->port = null;
|
||||
$this->login = (string)$login;
|
||||
$this->serverIp = null;
|
||||
$this->serverPort = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Server Ip and Port
|
||||
* Set the server ip and port
|
||||
*
|
||||
* @param string $ip Server Ip
|
||||
* @param int $port Server Port
|
||||
* @return \FML\ManiaCode\JoinServer
|
||||
* @param string $serverIp Server ip
|
||||
* @param int $serverPort Server port
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
*/
|
||||
public function setIp($ip, $port) {
|
||||
$this->ip = (string)$ip;
|
||||
$this->port = (int)$port;
|
||||
$this->login = null;
|
||||
public function setIp($serverIp, $serverPort) {
|
||||
$this->serverIp = (string)$serverIp;
|
||||
$this->serverPort = (int)$serverPort;
|
||||
$this->login = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -72,11 +71,11 @@ class JoinServer implements Element {
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
if ($this->ip === null) {
|
||||
if (is_null($this->serverIp)) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
} else {
|
||||
$ipElement = $domDocument->createElement('ip', $this->ip . ':' . $this->port);
|
||||
$ipElement = $domDocument->createElement('ip', $this->serverIp . ':' . $this->serverPort);
|
||||
$xmlElement->appendChild($ipElement);
|
||||
}
|
||||
return $xmlElement;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element playing a Map
|
||||
* ManiaCode Element for playing a map
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,44 +11,43 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class PlayMap implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'play_map';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new PlayMap Element
|
||||
* Create a new PlayMap object
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$playMap = new PlayMap($name, $url);
|
||||
return $playMap;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new PlayMap Element
|
||||
* Construct a new PlayMap object
|
||||
*
|
||||
* @param string $name (optional) Map Name
|
||||
* @param string $url (optional) Map Url
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Map
|
||||
* Set the name of the map
|
||||
*
|
||||
* @param string $name Map Name
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
* @param string $name Map name
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -56,10 +55,10 @@ class PlayMap implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Map
|
||||
* Set the url of the map
|
||||
*
|
||||
* @param string $url Map Url
|
||||
* @return \FML\ManiaCode\PlayMap
|
||||
* @param string $url Map url
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element playing a Replay
|
||||
* ManiaCode Element playing a replay
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,44 +11,43 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class PlayReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'play_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new PlayReplay Element
|
||||
* Create a new PlayReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$playReplay = new PlayReplay($name, $url);
|
||||
return $playReplay;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new PlayReplay Element
|
||||
* Construct a new PlayReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -56,10 +55,10 @@ class PlayReplay implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\PlayReplay
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
@ -11,38 +11,37 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class ShowMessage implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'show_message';
|
||||
protected $message = '';
|
||||
protected $message = null;
|
||||
|
||||
/**
|
||||
* Create a new ShowMessage Element
|
||||
* Create a new ShowMessage object
|
||||
*
|
||||
* @param string $message (optional) Message Text
|
||||
* @return \FML\ManiaCode\ShowMessage
|
||||
* @param string $message (optional) Message text
|
||||
* @return \FML\ManiaCode\ShowMessage|static
|
||||
*/
|
||||
public static function create($message = null) {
|
||||
$showMessage = new ShowMessage($message);
|
||||
return $showMessage;
|
||||
return new static($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ShowMessage Element
|
||||
* Construct a new ShowMessage object
|
||||
*
|
||||
* @param string $message (optional) Message Text
|
||||
* @param string $message (optional) Message text
|
||||
*/
|
||||
public function __construct($message = null) {
|
||||
if ($message !== null) {
|
||||
if (!is_null($message)) {
|
||||
$this->setMessage($message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the displayed Message Text
|
||||
* Set the message text
|
||||
*
|
||||
* @param string $message Message Text
|
||||
* @return \FML\ManiaCode\ShowMessage
|
||||
* @param string $message Message text
|
||||
* @return \FML\ManiaCode\ShowMessage|static
|
||||
*/
|
||||
public function setMessage($message) {
|
||||
$this->message = (string)$message;
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element viewing a Replay
|
||||
* ManiaCode Element for viewing a replay
|
||||
*
|
||||
* @author steeffeen <mail@steeffeen.com>
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
@ -11,44 +11,43 @@ namespace FML\ManiaCode;
|
||||
*/
|
||||
class ViewReplay implements Element {
|
||||
/*
|
||||
* Protected Properties
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'view_replay';
|
||||
protected $name = '';
|
||||
protected $url = '';
|
||||
protected $name = null;
|
||||
protected $url = null;
|
||||
|
||||
/**
|
||||
* Create a new ViewReplay Element
|
||||
* Create a new ViewReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
$viewReplay = new ViewReplay($name, $url);
|
||||
return $viewReplay;
|
||||
return new static($name, $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new ViewReplay Element
|
||||
* Construct a new ViewReplay object
|
||||
*
|
||||
* @param string $name (optional) Replay Name
|
||||
* @param string $url (optional) Replay Url
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
*/
|
||||
public function __construct($name = null, $url = null) {
|
||||
if ($name !== null) {
|
||||
if (!is_null($name)) {
|
||||
$this->setName($name);
|
||||
}
|
||||
if ($url !== null) {
|
||||
if (!is_null($url)) {
|
||||
$this->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Name of the Replay
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay Name
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -56,10 +55,10 @@ class ViewReplay implements Element {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Url of the Replay
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay Url
|
||||
* @return \FML\ManiaCode\ViewReplay
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
|
Reference in New Issue
Block a user