Updated FML to newest version

This commit is contained in:
Jocy
2017-04-02 16:32:57 +02:00
parent 83710a9269
commit c5926aded2
21 changed files with 1425 additions and 995 deletions

View File

@ -64,7 +64,8 @@ class ManiaLinks
* @api
* @param ManiaLink $child Child ManiaLink
* @return static
* @deprecated use addChild() instead
* @deprecated Use addChild()
* @see ManiaLinks::addChild()
*/
public function add(ManiaLink $child)
{
@ -86,6 +87,21 @@ class ManiaLinks
return $this;
}
/**
* Add child ManiaLinks
*
* @api
* @param ManiaLink[] $children Child ManiaLinks
* @return static
*/
public function addChildren(array $children)
{
foreach ($children as $child) {
$this->addChild($child);
}
return $this;
}
/**
* Set ManiaLink children
*
@ -95,23 +111,8 @@ class ManiaLinks
*/
public function setChildren(array $children)
{
$this->children = array();
foreach ($children as $child) {
$this->addChild($child);
}
return $this;
}
/**
* Remove all child ManiaLinks
*
* @api
* @return static
* @deprecated use removeAllChildren instead
*/
public function removeChildren()
{
return $this->removeAllChildren();
return $this->removeAllChildren()
->addChildren($children);
}
/**
@ -126,14 +127,31 @@ class ManiaLinks
return $this;
}
/**
* Remove all child ManiaLinks
*
* @api
* @return static
* @deprecated Use removeAllChildren()
* @see ManiaLinks::removeAllChildren()
*/
public function removeChildren()
{
return $this->removeAllChildren();
}
/**
* Get the CustomUI
*
* @api
* @param bool $createIfEmpty (optional) If the Custom UI should be created if it doesn't exist yet
* @return CustomUI
*/
public function getCustomUI()
public function getCustomUI($createIfEmpty = true)
{
if (!$this->customUI && $createIfEmpty) {
$this->setCustomUI(new CustomUI());
}
return $this->customUI;
}