Backend\Core\Engine\Meta::__construct PHP Method

__construct() public method

public __construct ( Form $form, integer $metaId = null, string $baseFieldName = 'title', boolean $custom = false )
$form Form An instance of Form, the elements will be parsed in here.
$metaId integer The metaID to load.
$baseFieldName string The field where the URL should be based on.
$custom boolean Add/show custom-meta.
    public function __construct(Form $form, $metaId = null, $baseFieldName = 'title', $custom = false)
    {
        // check if URL is available from the reference
        if (!BackendModel::getContainer()->has('url')) {
            throw new Exception('URL should be available in the reference.');
        }
        // get BackendURL instance
        $this->URL = BackendModel::getContainer()->get('url');
        // should we use meta-custom
        $this->custom = (bool) $custom;
        // set form instance
        $this->frm = $form;
        // set base field name
        $this->baseFieldName = (string) $baseFieldName;
        // metaId was specified, so we should load the item
        if ($metaId !== null) {
            $this->loadMeta($metaId);
        }
        // set default callback
        $this->setURLCallback('Backend\\Modules\\' . $this->URL->getModule() . '\\Engine\\Model', 'getURL');
        // load the form
        $this->loadForm();
    }