public function attachments()
    {
        $attachableObjects = $this->attachableObjects();
        $attachments       = $this->obj()->getAttachments([
            'group' => $this->group()
        ]);

        foreach ($attachments as $attachment) {
            $GLOBALS['widget_template'] = (string)$attachment->rawPreview();

            if (isset($attachableObjects[$attachment->objType()])) {
                $attachment->attachmentType = $attachableObjects[$attachment->objType()];
            } else {
                continue;
            }

            yield $attachment;

            $GLOBALS['widget_template'] = '';
        }
    }
public function attachments()
    {
        $attachableObjects = $this->attachableObjects();
        $attachments       = $this->obj()->getAttachments([
            'group' => $this->group()
        ]);

        foreach ($attachments as $attachment) {
            $GLOBALS['widget_template'] = (string)$attachment->rawPreview();

            if (isset($attachableObjects[$attachment->objType()])) {
                $attachment->attachmentType = $attachableObjects[$attachment->objType()];
            } else {
                continue;
            }

            yield $attachment;

            $GLOBALS['widget_template'] = '';
        }
    }
public function attachments ( ) { $ attachableObjects = $ this -> attachableObjects ( ) ; $ attachments = $ this -> obj ( ) -> getAttachments ( [ 'group' => $ this -> group ( ) ] ) ; foreach ( $ attachments as $ attachment ) { $ GLOBALS [ 'widget_template' ] = ( string ) $ attachment -> rawPreview ( ) ; if ( isset ( $ attachableObjects [ $ attachment -> objType ( ) ] ) ) { $ attachment -> attachmentType = $ attachableObjects [ $ attachment -> objType ( ) ] ; } else { continue ; } yield $ attachment ; $ GLOBALS [ 'widget_template' ] = '' ; } }
Attachment by groups.

@return \Generator
Attachment by groups .