public function setForm($key, $spec, $enabled = true)
    {
        if (is_object($spec)) {
            if (!$spec instanceof Container) {
                throw new \InvalidArgumentException('Tab container must be of the type \Core\Form\Container');
            }

            if (!$spec->getLabel()) {
                throw new \InvalidArgumentException('Container instances must have a label.');
            }
        }

        if (is_array($spec)) {
            if (!isset($spec['type'])) {
                $spec['type'] = 'Core/Container';
            }

            /*
             * For convenience, forms may be specified outside the options array.
             * But in order to be passed through to the form element manager,
             * we must move it to the options.
             */
            if (!isset($spec['options']['forms']) && isset($spec['forms'])) {
                $spec['options']['forms'] = $spec['forms'];
                unset($spec['forms']);
            }
        }

        return parent::setForm($key, $spec, $enabled);
    }