<?php
// Copyright 1999-2017. Plesk International GmbH. All rights reserved.

namespace Plesk\MigrationLibV8\Plesk\PleskClasses;

/**
 * Wrapper around Plesk form subsection, used directly by extension, without using official extensions SDK.
 */

/** @noinspection PhpUndefinedClassInspection */
class FormSection extends \CommonPanel_Form_Section
{
    private $section;

    public function __construct()
    {
        /** @noinspection PhpUndefinedClassInspection */
        $this->section = new \CommonPanel_Form_Section();
    }

    public function setLegend($legend)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $this->section->setLegend($legend);
    }

    public function addElement($element, $name = null, $options = null)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $this->section->addElement($element, $name, $options);
    }

    public function getElement($name)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        return $this->section->getElement($name);
    }

    /**
     * @return \Zend_Form_SubForm
     */
    public function getZendFormSubForm()
    {
        /** @noinspection PhpIncompatibleReturnTypeInspection */
        return $this->section;
    }
}
