public function attachableObjects()
    {
        if ($this->attachableObjects === null) {
            $this->attachableObjects = [];

            $config = $this->attachmentsMetadata();
            if (isset($config['attachable_objects'])) {
                foreach ($config['attachable_objects'] as $attType => $attMeta) {
                    // Disable an attachable model
                    if (isset($attMeta['active']) && !$attMeta['active']) {
                        continue;
                    }

                    // Useful for replacing a pre-defined attachment type
                    if (isset($attMeta['attachment_type'])) {
                        $attType = $attMeta['attachment_type'];
                    } else {
                        $attMeta['attachment_type'] = $attType;
                    }

                    // Alias
                    $attMeta['attachmentType'] = $attMeta['attachment_type'];

                    if (isset($attMeta['label'])) {
                        $attMeta['label'] = $this->translator()->translation($attMeta['label']);
                    } else {
                        $attMeta['label'] = ucfirst(basename($attType));
                    }

                    $faIcon = '';
                    if (isset($attMeta['fa_icon']) && !empty($attMeta['fa_icon'])) {
                        $faIcon = 'fa fa-'.$attMeta['fa_icon'];
                    } elseif ($this->attachmentWidget()) {
                        $attParts = explode('/', $attType);
                        $defaultIcons = $this->attachmentWidget()->defaultIcons();
                        if (isset($defaultIcons[end($attParts)])) {
                            $faIcon = 'fa fa-'.$defaultIcons[end($attParts)];
                        }
                    }

                    $attMeta['faIcon'] = $faIcon;
                    $attMeta['hasFaIcon'] = !!$faIcon;

                    // Custom forms
                    if (isset($attMeta['form_ident'])) {
                        $attMeta['formIdent'] = $attMeta['form_ident'];
                    } else {
                        $attMeta['formIdent'] = null;
                    }

                    if (isset($attMeta['quick_form_ident'])) {
                        $attMeta['quickFormIdent'] = $attMeta['quick_form_ident'];
                    } else {
                        $attMeta['quickFormIdent'] = null;
                    }

                    $this->attachableObjects[$attType] = $attMeta;
                }
            }
        }

        return $this->attachableObjects;
    }
public function attachableObjects()
    {
        if ($this->attachableObjects === null) {
            $this->attachableObjects = [];

            $config = $this->attachmentsMetadata();
            if (isset($config['attachable_objects'])) {
                foreach ($config['attachable_objects'] as $attType => $attMeta) {
                    // Disable an attachable model
                    if (isset($attMeta['active']) && !$attMeta['active']) {
                        continue;
                    }

                    // Useful for replacing a pre-defined attachment type
                    if (isset($attMeta['attachment_type'])) {
                        $attType = $attMeta['attachment_type'];
                    } else {
                        $attMeta['attachment_type'] = $attType;
                    }

                    // Alias
                    $attMeta['attachmentType'] = $attMeta['attachment_type'];

                    if (isset($attMeta['label'])) {
                        $attMeta['label'] = $this->translator()->translation($attMeta['label']);
                    } else {
                        $attMeta['label'] = ucfirst(basename($attType));
                    }

                    $faIcon = '';
                    if (isset($attMeta['fa_icon']) && !empty($attMeta['fa_icon'])) {
                        $faIcon = 'fa fa-'.$attMeta['fa_icon'];
                    } elseif ($this->attachmentWidget()) {
                        $attParts = explode('/', $attType);
                        $defaultIcons = $this->attachmentWidget()->defaultIcons();
                        if (isset($defaultIcons[end($attParts)])) {
                            $faIcon = 'fa fa-'.$defaultIcons[end($attParts)];
                        }
                    }

                    $attMeta['faIcon'] = $faIcon;
                    $attMeta['hasFaIcon'] = !!$faIcon;

                    // Custom forms
                    if (isset($attMeta['form_ident'])) {
                        $attMeta['formIdent'] = $attMeta['form_ident'];
                    } else {
                        $attMeta['formIdent'] = null;
                    }

                    if (isset($attMeta['quick_form_ident'])) {
                        $attMeta['quickFormIdent'] = $attMeta['quick_form_ident'];
                    } else {
                        $attMeta['quickFormIdent'] = null;
                    }

                    $this->attachableObjects[$attType] = $attMeta;
                }
            }
        }

        return $this->attachableObjects;
    }
public function attachableObjects ( ) { if ( $ this -> attachableObjects === null ) { $ this -> attachableObjects = [ ] ; $ config = $ this -> attachmentsMetadata ( ) ; if ( isset ( $ config [ 'attachable_objects' ] ) ) { foreach ( $ config [ 'attachable_objects' ] as $ attType => $ attMeta ) { // Disable an attachable model if ( isset ( $ attMeta [ 'active' ] ) && ! $ attMeta [ 'active' ] ) { continue ; } // Useful for replacing a pre-defined attachment type if ( isset ( $ attMeta [ 'attachment_type' ] ) ) { $ attType = $ attMeta [ 'attachment_type' ] ; } else { $ attMeta [ 'attachment_type' ] = $ attType ; } // Alias $ attMeta [ 'attachmentType' ] = $ attMeta [ 'attachment_type' ] ; if ( isset ( $ attMeta [ 'label' ] ) ) { $ attMeta [ 'label' ] = $ this -> translator ( ) -> translation ( $ attMeta [ 'label' ] ) ; } else { $ attMeta [ 'label' ] = ucfirst ( basename ( $ attType ) ) ; } $ faIcon = '' ; if ( isset ( $ attMeta [ 'fa_icon' ] ) && ! empty ( $ attMeta [ 'fa_icon' ] ) ) { $ faIcon = 'fa fa-' . $ attMeta [ 'fa_icon' ] ; } elseif ( $ this -> attachmentWidget ( ) ) { $ attParts = explode ( '/' , $ attType ) ; $ defaultIcons = $ this -> attachmentWidget ( ) -> defaultIcons ( ) ; if ( isset ( $ defaultIcons [ end ( $ attParts ) ] ) ) { $ faIcon = 'fa fa-' . $ defaultIcons [ end ( $ attParts ) ] ; } } $ attMeta [ 'faIcon' ] = $ faIcon ; $ attMeta [ 'hasFaIcon' ] = ! ! $ faIcon ; // Custom forms if ( isset ( $ attMeta [ 'form_ident' ] ) ) { $ attMeta [ 'formIdent' ] = $ attMeta [ 'form_ident' ] ; } else { $ attMeta [ 'formIdent' ] = null ; } if ( isset ( $ attMeta [ 'quick_form_ident' ] ) ) { $ attMeta [ 'quickFormIdent' ] = $ attMeta [ 'quick_form_ident' ] ; } else { $ attMeta [ 'quickFormIdent' ] = null ; } $ this -> attachableObjects [ $ attType ] = $ attMeta ; } } } return $ this -> attachableObjects ; }
Returns attachable objects

@return array Attachable Objects
Returns attachable objects