libraries/ManiaLib/Gui/Element.php
final function save()
    {
        if ($this->visible === false) {
            return;
        }

        $this->preFilter();

        $layout = $this->getParentLayout();
        if ($layout instanceof Layouts\AbstractLayout) {
            $layout->preFilter($this);
            $layout->updateComponent($this);
        }

        $frame = $this->getParentFrame();
        if ($frame instanceof Elements\Frame) {
            if ($frame->getSizeX()) {
                $x = Tools::getAlignedPosX(0, $frame->getSizeX(), $frame->getHalign('left'), $this->getRelativeHalign('left'));
                $this->incPosX($x);
            }
            if ($frame->getSizeY()) {
                $y = Tools::getAlignedPosY(0, $frame->getSizeY(), $frame->getValign('top'), $this->getRelativeValign('top'));
                $this->incPosY($y);
            }
        }

        $this->buildXML();

        if ($layout instanceof Layouts\AbstractLayout) {
            $layout->postFilter($this);
        }

        $this->handleCardElements();

        $this->postFilter();
    }
final function save()
    {
        if ($this->visible === false) {
            return;
        }

        $this->preFilter();

        $layout = $this->getParentLayout();
        if ($layout instanceof Layouts\AbstractLayout) {
            $layout->preFilter($this);
            $layout->updateComponent($this);
        }

        $frame = $this->getParentFrame();
        if ($frame instanceof Elements\Frame) {
            if ($frame->getSizeX()) {
                $x = Tools::getAlignedPosX(0, $frame->getSizeX(), $frame->getHalign('left'), $this->getRelativeHalign('left'));
                $this->incPosX($x);
            }
            if ($frame->getSizeY()) {
                $y = Tools::getAlignedPosY(0, $frame->getSizeY(), $frame->getValign('top'), $this->getRelativeValign('top'));
                $this->incPosY($y);
            }
        }

        $this->buildXML();

        if ($layout instanceof Layouts\AbstractLayout) {
            $layout->postFilter($this);
        }

        $this->handleCardElements();

        $this->postFilter();
    }
Saves the object in the Manialink object stack for further rendering.
Thanks to the use of \ManiaLib\Gui\Element::preFilter() and \ManiaLib\Gui\Element::
postFilter(), you shouldn't have to override this method