\midcom\dbaattachments

midcom attachment support

Summary

Methods
Properties
Constants
get_attachment()
delete_attachment()
create_attachment()
get_attachment_qb()
list_attachments()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

get_attachment()

get_attachment(string  $name) : \midcom_db_attachment

Retrieves an attachment by its name.

If multiple attachments match the name (should not happen in reality), the first match will be returned.

Parameters

string $name

The name of the attachment to look up.

Returns

\midcom_db_attachment

The attachment found, or false on failure.

delete_attachment()

delete_attachment(string  $name) : boolean

Delete an attachment by its name.

If multiple attachments match the name (should not happen in reality), the first match will be deleted.

Parameters

string $name

The name of the attachment to delete.

Returns

boolean —

Indicating success.

create_attachment()

create_attachment(string  $name, string  $title, string  $mimetype) : \midcom_db_attachment

Creates a new attachment at the current object and returns it for usage.

Parameters

string $name

The name of the attachment.

string $title

The title of the attachment.

string $mimetype

The MIME-Type of the attachment.

Returns

\midcom_db_attachment

The created attachment or false on failure.

get_attachment_qb()

get_attachment_qb() : \midcom_core_querybuilder

Returns a prepared query builder that is already limited to the attachments of the given object.

Returns

\midcom_core_querybuilder

The initialized instance of the query builder or false on failure.

list_attachments()

list_attachments() : array<mixed,\midcom_db_attachment>

Returns a complete list of attachments for the current object. If there are no attachments, an empty array is returned.

Returns

array<mixed,\midcom_db_attachment> —

A list of attachments