MessageQuery
class MessageQuery implements MessageQueryInterface mixin ImapQueryBuilder (View source)
Traits
Properties
| protected ImapQueryBuilder | $query | The query builder instance. |
from QueriesMessages |
| protected int | $page | The current page. |
from QueriesMessages |
| protected int|null | $limit | The fetch limit. |
from QueriesMessages |
| protected bool | $fetchBody | Whether to fetch the message body. |
from QueriesMessages |
| protected bool | $fetchFlags | Whether to fetch the message flags. |
from QueriesMessages |
| protected bool | $fetchHeaders | Whether to fetch the message headers. |
from QueriesMessages |
| protected bool | $fetchSize | Whether to fetch the message size. |
from QueriesMessages |
| protected "asc"|"desc" | $fetchOrder | The fetch order. |
from QueriesMessages |
| protected bool | $fetchAsUnread | Whether to leave messages fetched as unread by default. |
from QueriesMessages |
| protected array | $passthru | The methods that should be returned from query builder. |
from QueriesMessages |
Methods
Forward a method call to the given object.
Throw a bad method call exception for the given method.
Handle dynamic method calls into the query builder.
Set whether to fetch the flags.
Set whether to fetch the headers.
Set whether to fetch the size.
Count all available messages matching the current search criteria.
Get the first message in the resulting collection.
Get the first message in the resulting collection or throw an exception.
Get the messages matching the current query.
Append a new message to the folder.
Execute a callback over each message via a chunked query.
Execute a callback over each chunk of messages.
Paginate the current query.
Find a message by the given identifier type or throw an exception.
Find a message by the given identifier type.
Destroy the given messages.
Process the collection of messages.
Populate a given id collection and receive a fully fetched message collection.
Fetch a given id collection.
Execute an IMAP search request.
Get the UID for the given identifier.
Make a new message from given raw components.
Get the connection instance.
Details
protected mixed
forwardCallTo(object $object, string $method, array $parameters)
Forward a method call to the given object.
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
mixed
__call(string $method, array $parameters)
Handle dynamic method calls into the query builder.
MessageQueryInterface
leaveUnread()
{@inheritDoc}
MessageQueryInterface
markAsRead()
{@inheritDoc}
MessageQueryInterface
limit(int $limit, int $page = 1)
{@inheritDoc}
int|null
getLimit()
{@inheritDoc}
MessageQueryInterface
setLimit(int $limit)
{@inheritDoc}
int
getPage()
{@inheritDoc}
MessageQueryInterface
setPage(int $page)
{@inheritDoc}
bool
isFetchingBody()
{@inheritDoc}
bool
isFetchingFlags()
{@inheritDoc}
bool
isFetchingHeaders()
{@inheritDoc}
bool
isFetchingSize()
{@inheritDoc}
MessageQueryInterface
withFlags()
{@inheritDoc}
MessageQueryInterface
withBody()
{@inheritDoc}
MessageQueryInterface
withHeaders()
{@inheritDoc}
MessageQueryInterface
withSize()
{@inheritDoc}
MessageQueryInterface
withoutBody()
{@inheritDoc}
MessageQueryInterface
withoutHeaders()
{@inheritDoc}
MessageQueryInterface
withoutFlags()
{@inheritDoc}
MessageQueryInterface
withoutSize()
{@inheritDoc}
protected MessageQueryInterface
setFetchFlags(bool $fetchFlags)
Set whether to fetch the flags.
protected MessageQueryInterface
setFetchBody(bool $fetchBody)
Set the fetch body flag.
protected MessageQueryInterface
setFetchHeaders(bool $fetchHeaders)
Set whether to fetch the headers.
protected MessageQueryInterface
setFetchSize(bool $fetchSize)
Set whether to fetch the size.
MessageQueryInterface
setFetchOrder(string $fetchOrder)
{@inheritDoc}
string
getFetchOrder()
{@inheritDoc}
MessageQueryInterface
setFetchOrderAsc()
{@inheritDoc}
MessageQueryInterface
setFetchOrderDesc()
{@inheritDoc}
MessageQueryInterface
oldest()
{@inheritDoc}
MessageQueryInterface
newest()
{@inheritDoc}
__construct(FolderInterface $folder, ImapQueryBuilder $query)
Constructor.
int
count()
Count all available messages matching the current search criteria.
MessageInterface|null
first()
Get the first message in the resulting collection.
MessageInterface
firstOrFail()
Get the first message in the resulting collection or throw an exception.
MessageCollection
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.
LengthAwarePaginator
paginate(int $perPage = 5, $page = null, string $pageName = 'page')
Paginate the current query.
MessageInterface
findOrFail(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)
Find a message by the given identifier type or throw an exception.
MessageInterface|null
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.
protected MessageCollection
process(Collection $messages)
Process the collection of messages.
protected MessageCollection
populate(Collection $uids)
Populate a given id collection and receive a fully fetched message collection.
protected array
fetch(Collection $messages)
Fetch a given id collection.
protected Collection
search()
Execute an IMAP search request.
protected ResponseCollection
id(int $id, ImapFetchIdentifier $identifier = ImapFetchIdentifier::Uid)
Get the UID for the given identifier.
protected Message
newMessage(int $uid, array $flags, string $headers, string $contents, int|null $size = null)
Make a new message from given raw components.
protected ConnectionInterface
connection()
Get the connection instance.