2014-04-27 14:44:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FML\Script;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class representing a Function of the ManiaLink Script
|
|
|
|
*
|
2014-05-18 19:45:50 +02:00
|
|
|
* @author steeffeen
|
2014-04-27 14:44:40 +02:00
|
|
|
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
2014-05-18 19:45:50 +02:00
|
|
|
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
2014-04-27 14:44:40 +02:00
|
|
|
*/
|
|
|
|
class ScriptFunction {
|
|
|
|
/*
|
|
|
|
* Protected Properties
|
|
|
|
*/
|
|
|
|
protected $name = null;
|
|
|
|
protected $text = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct a new Script Function
|
|
|
|
*
|
|
|
|
* @param string $name (optional) Function Name
|
|
|
|
* @param string $text (optional) Function Text
|
|
|
|
*/
|
|
|
|
public function __construct($name = null, $text = null) {
|
|
|
|
$this->setName($name);
|
|
|
|
$this->setText($text);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the Name
|
|
|
|
*
|
|
|
|
* @param string $name Function Name
|
|
|
|
* @return \FML\Script\ScriptFunction
|
|
|
|
*/
|
|
|
|
public function setName($name) {
|
2014-05-18 19:45:50 +02:00
|
|
|
$this->name = (string)$name;
|
2014-04-27 14:44:40 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the Text
|
|
|
|
*
|
|
|
|
* @param string $text Function Text
|
|
|
|
* @return \FML\Script\ScriptFunction
|
|
|
|
*/
|
|
|
|
public function setText($text) {
|
2014-05-18 19:45:50 +02:00
|
|
|
$this->text = (string)$text;
|
2014-04-27 14:44:40 +02:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Script Function Text
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function __toString() {
|
|
|
|
return $this->text;
|
|
|
|
}
|
|
|
|
}
|