interface MessageQueryInterface mixin ImapQueryBuilder (View source)

Methods

leaveUnread()

Don't mark messages as read when fetching.

markAsRead()

Mark all messages as read when fetching.

limit(int $limit, int $page = 1)

Set the limit and page for the current query.

int|null
getLimit()

Get the set fetch limit.

setLimit(int $limit)

Set the fetch limit.

int
getPage()

Get the set page.

setPage(int $page)

Set the page.

bool
isFetchingBody()

Determine if the body of messages is being fetched.

bool
isFetchingFlags()

Determine if the flags of messages is being fetched.

bool
isFetchingHeaders()

Determine if the headers of messages is being fetched.

bool
isFetchingSize()

Determine if the size of messages is being fetched.

bool
isFetchingBodyStructure()

Determine if the body structure of messages is being fetched.

withFlags()

Fetch the flags of messages.

withBody()

Fetch the body of messages.

withHeaders()

Fetch the headers of messages.

withSize()

Fetch the size of messages.

withBodyStructure()

Fetch the body structure of messages.

withoutBody()

Don't fetch the body of messages.

withoutHeaders()

Don't fetch the headers of messages.

withoutFlags()

Don't fetch the flags of messages.

withoutSize()

Don't fetch the size of messages.

withoutBodyStructure()

Don't fetch the body structure of messages.

setFetchOrder(string $fetchOrder)

Set the fetch order.

string
getFetchOrder()

Get the fetch order.

setFetchOrderAsc()

Set the fetch order to 'ascending'.

setFetchOrderDesc()

Set the fetch order to 'descending'.

oldest()

Set the fetch order to show oldest messages first (ascending).

newest()

Set the fetch order to show newest messages first (descending).

setSortKey(ImapSortKey|string|null $key)

Set the sort key for server-side sorting (RFC 5256).

ImapSortKey|null
getSortKey()

Get the sort key for server-side sorting.

setSortDirection(string $direction)

Set the sort direction for server-side sorting.

string
getSortDirection()

Get the sort direction for server-side sorting.

sortBy(ImapSortKey|string $key, string $direction = 'asc')

Sort messages by a field using server-side sorting (RFC 5256).

sortByDesc(ImapSortKey|string $key)

Sort messages by a field in descending order using server-side sorting.

int
count()

Count all available messages matching the current search criteria.

first()

Get the first message in the resulting collection.

firstOrFail()

Get the first message in the resulting collection or throw an exception.

get()

Get the messages matching the current query.

int
append(string $message, mixed $flags = null)

Append a new message to the folder.

void
each(callable $callback, int $chunkSize = 10, int $startChunk = 1)

Execute a callback over each message via a chunked query.

void
chunk(callable $callback, int $chunkSize = 10, int $startChunk = 1)

Execute a callback over each chunk of messages.

paginate(int $perPage = 5, $page = null, string $pageName = 'page')

Paginate the current query.

findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)

Find a message by the given identifier type or throw an exception.

find(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)

Find a message by the given identifier type.

void
destroy(array|int $uids, bool $expunge = false)

Destroy the given messages.

int
flag(BackedEnum|string $flag, string $operation, bool $expunge = false)

Add or remove a flag from all messages matching the current query.

int
markRead()

Mark all messages matching the current query as read.

int
markUnread()

Mark all messages matching the current query as unread.

int
markFlagged()

Mark all messages matching the current query as flagged.

int
unmarkFlagged()

Unmark all messages matching the current query as flagged.

int
delete(bool $expunge = false)

Delete all messages matching the current query.

int
move(string $folder, bool $expunge = false)

Move all messages matching the current query to the given folder.

int
copy(string $folder)

Copy all messages matching the current query to the given folder.

Details

MessageQueryInterface leaveUnread()

Don't mark messages as read when fetching.

Return Value

MessageQueryInterface

MessageQueryInterface markAsRead()

Mark all messages as read when fetching.

Return Value

MessageQueryInterface

MessageQueryInterface limit(int $limit, int $page = 1)

Set the limit and page for the current query.

Parameters

int $limit
int $page

Return Value

MessageQueryInterface

int|null getLimit()

Get the set fetch limit.

Return Value

int|null

MessageQueryInterface setLimit(int $limit)

Set the fetch limit.

Parameters

int $limit

Return Value

MessageQueryInterface

int getPage()

Get the set page.

Return Value

int

MessageQueryInterface setPage(int $page)

Set the page.

Parameters

int $page

Return Value

MessageQueryInterface

bool isFetchingBody()

Determine if the body of messages is being fetched.

Return Value

bool

bool isFetchingFlags()

Determine if the flags of messages is being fetched.

Return Value

bool

bool isFetchingHeaders()

Determine if the headers of messages is being fetched.

Return Value

bool

bool isFetchingSize()

Determine if the size of messages is being fetched.

Return Value

bool

bool isFetchingBodyStructure()

Determine if the body structure of messages is being fetched.

Return Value

bool

MessageQueryInterface withFlags()

Fetch the flags of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withBody()

Fetch the body of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withHeaders()

Fetch the headers of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withSize()

Fetch the size of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withBodyStructure()

Fetch the body structure of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withoutBody()

Don't fetch the body of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withoutHeaders()

Don't fetch the headers of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withoutFlags()

Don't fetch the flags of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withoutSize()

Don't fetch the size of messages.

Return Value

MessageQueryInterface

MessageQueryInterface withoutBodyStructure()

Don't fetch the body structure of messages.

Return Value

MessageQueryInterface

MessageQueryInterface setFetchOrder(string $fetchOrder)

Set the fetch order.

Parameters

string $fetchOrder

Return Value

MessageQueryInterface

string getFetchOrder()

Get the fetch order.

Return Value

string

MessageQueryInterface setFetchOrderAsc()

Set the fetch order to 'ascending'.

Return Value

MessageQueryInterface

MessageQueryInterface setFetchOrderDesc()

Set the fetch order to 'descending'.

Return Value

MessageQueryInterface

MessageQueryInterface oldest()

Set the fetch order to show oldest messages first (ascending).

Return Value

MessageQueryInterface

MessageQueryInterface newest()

Set the fetch order to show newest messages first (descending).

Return Value

MessageQueryInterface

MessageQueryInterface setSortKey(ImapSortKey|string|null $key)

Set the sort key for server-side sorting (RFC 5256).

Parameters

ImapSortKey|string|null $key

Return Value

MessageQueryInterface

ImapSortKey|null getSortKey()

Get the sort key for server-side sorting.

Return Value

ImapSortKey|null

MessageQueryInterface setSortDirection(string $direction)

Set the sort direction for server-side sorting.

Parameters

string $direction

Return Value

MessageQueryInterface

string getSortDirection()

Get the sort direction for server-side sorting.

Return Value

string

MessageQueryInterface sortBy(ImapSortKey|string $key, string $direction = 'asc')

Sort messages by a field using server-side sorting (RFC 5256).

Parameters

ImapSortKey|string $key
string $direction

Return Value

MessageQueryInterface

MessageQueryInterface sortByDesc(ImapSortKey|string $key)

Sort messages by a field in descending order using server-side sorting.

Parameters

ImapSortKey|string $key

Return Value

MessageQueryInterface

int count()

Count all available messages matching the current search criteria.

Return Value

int

MessageInterface|null first()

Get the first message in the resulting collection.

Return Value

MessageInterface|null

MessageInterface firstOrFail()

Get the first message in the resulting collection or throw an exception.

Return Value

MessageInterface

MessageCollection get()

Get the messages matching the current query.

Return Value

MessageCollection

int append(string $message, mixed $flags = null)

Append a new message to the folder.

Parameters

string $message
mixed $flags

Return Value

int

void each(callable $callback, int $chunkSize = 10, int $startChunk = 1)

Execute a callback over each message via a chunked query.

Parameters

callable $callback
int $chunkSize
int $startChunk

Return Value

void

void chunk(callable $callback, int $chunkSize = 10, int $startChunk = 1)

Execute a callback over each chunk of messages.

Parameters

callable $callback
int $chunkSize
int $startChunk

Return Value

void

LengthAwarePaginator paginate(int $perPage = 5, $page = null, string $pageName = 'page')

Paginate the current query.

Parameters

int $perPage
$page
string $pageName

Return Value

LengthAwarePaginator

MessageInterface findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)

Find a message by the given identifier type or throw an exception.

Parameters

int $id
ImapFetchIdentifier $identifier

Return Value

MessageInterface

MessageInterface|null find(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)

Find a message by the given identifier type.

Parameters

int $id
ImapFetchIdentifier $identifier

Return Value

MessageInterface|null

void destroy(array|int $uids, bool $expunge = false)

Destroy the given messages.

Parameters

array|int $uids
bool $expunge

Return Value

void

int flag(BackedEnum|string $flag, string $operation, bool $expunge = false)

Add or remove a flag from all messages matching the current query.

Parameters

BackedEnum|string $flag
string $operation '+'|'-'
bool $expunge

Return Value

int

The number of messages affected.

int markRead()

Mark all messages matching the current query as read.

Return Value

int

The number of messages affected.

int markUnread()

Mark all messages matching the current query as unread.

Return Value

int

The number of messages affected.

int markFlagged()

Mark all messages matching the current query as flagged.

Return Value

int

The number of messages affected.

int unmarkFlagged()

Unmark all messages matching the current query as flagged.

Return Value

int

The number of messages affected.

int delete(bool $expunge = false)

Delete all messages matching the current query.

Parameters

bool $expunge

Return Value

int

The number of messages affected.

int move(string $folder, bool $expunge = false)

Move all messages matching the current query to the given folder.

Parameters

string $folder
bool $expunge

Return Value

int

The number of messages affected.

int copy(string $folder)

Copy all messages matching the current query to the given folder.

Parameters

string $folder

Return Value

int

The number of messages affected.