public function setAttachables(array $attachables)
    {
        foreach ($attachables as $attType => $attStruct) {
            if (!is_array($attStruct)) {
                throw new InvalidArgumentException(sprintf(
                    'The attachment structure for "%s" must be an array',
                    $attType
                ));
            }

            if (isset($attStruct['attachment_type'])) {
                $attType = $attStruct['attachment_type'];
            } else {
                $attStruct['attachment_type'] = $attType;
            }

            if (!is_string($attType)) {
                throw new InvalidArgumentException(
                    'The attachment type must be a string'
                );
            }

            $this->attachables[$attType] = $attStruct;
        }

        return $this;
    }
public function setAttachables(array $attachables)
    {
        foreach ($attachables as $attType => $attStruct) {
            if (!is_array($attStruct)) {
                throw new InvalidArgumentException(sprintf(
                    'The attachment structure for "%s" must be an array',
                    $attType
                ));
            }

            if (isset($attStruct['attachment_type'])) {
                $attType = $attStruct['attachment_type'];
            } else {
                $attStruct['attachment_type'] = $attType;
            }

            if (!is_string($attType)) {
                throw new InvalidArgumentException(
                    'The attachment type must be a string'
                );
            }

            $this->attachables[$attType] = $attStruct;
        }

        return $this;
    }
public function setAttachables ( array $ attachables ) { foreach ( $ attachables as $ attType => $ attStruct ) { if ( ! is_array ( $ attStruct ) ) { throw new InvalidArgumentException ( sprintf ( 'The attachment structure for "%s" must be an array' , $ attType ) ) ; } if ( isset ( $ attStruct [ 'attachment_type' ] ) ) { $ attType = $ attStruct [ 'attachment_type' ] ; } else { $ attStruct [ 'attachment_type' ] = $ attType ; } if ( ! is_string ( $ attType ) ) { throw new InvalidArgumentException ( 'The attachment type must be a string' ) ; } $ this -> attachables [ $ attType ] = $ attStruct ; } return $ this ; }
Set attachment types.

@param  array $attachables One or more attachment types.
@throws InvalidArgumentException If the attachment type or structure is invalid.
@return AttachmentsConfig Chainable
Set attachment types .