protected function addAttachmentGroupFromMetadata($reload = false)
    {
        if ($this->obj() instanceof TemplateableInterface) {
            $this->setControllerIdent($this->obj()->templateIdentClass());
        }

        if ($reload || !$this->isAttachmentMetadataFinalized) {
            $obj                 = $this->obj();
            $controllerInterface = $this->controllerIdent();

            $interfaces = [$this->objType()];

            if ($controllerInterface) {
                array_push($interfaces, $controllerInterface);
            }

            $structureMetadata = $this->createMetadata();

            if (count($interfaces)) {
                $controllerMetadataIdent = sprintf('widget/metadata/%s/%s', $obj->objType(), $obj->id());
                $structureMetadata       = $this->metadataLoader()->load(
                    $controllerMetadataIdent,
                    $structureMetadata,
                    $interfaces
                );
            }

            $attachmentWidgets = $structureMetadata->get('attachments.widgets');
            foreach ((array)$attachmentWidgets as $ident => $metadata) {
                $this->addGroup($ident, $metadata);
            }

            $this->isAttachmentMetadataFinalized = true;
        }
    }