class FakeMessageQuery implements MessageQueryInterface (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

mixed
forwardCallTo(object $object, string $method, array $parameters)

Forward a method call to the given object.

static 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.

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

{@inheritDoc}

int|null
getLimit()

{@inheritDoc}

setLimit(int $limit)

{@inheritDoc}

int
getPage()

{@inheritDoc}

setPage(int $page)

{@inheritDoc}

bool
isFetchingBody()

{@inheritDoc}

bool
isFetchingFlags()

{@inheritDoc}

bool
isFetchingHeaders()

{@inheritDoc}

bool
isFetchingSize()

{@inheritDoc}

setFetchFlags(bool $fetchFlags)

Set whether to fetch the flags.

setFetchBody(bool $fetchBody)

Set the fetch body flag.

setFetchHeaders(bool $fetchHeaders)

Set whether to fetch the headers.

setFetchSize(bool $fetchSize)

Set whether to fetch the size.

setFetchOrder(string $fetchOrder)

{@inheritDoc}

string
getFetchOrder()

{@inheritDoc}

__construct(FakeFolder $folder, ImapQueryBuilder $query = new ImapQueryBuilder())

Constructor.

get()

Get the messages matching the current query.

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.

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.

Details

protected mixed forwardCallTo(object $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

object $object
string $method
array $parameters

Return Value

mixed

static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

mixed __call(string $method, array $parameters)

Handle dynamic method calls into the query builder.

Parameters

string $method
array $parameters

Return Value

mixed

MessageQueryInterface leaveUnread()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface markAsRead()

{@inheritDoc}

Return Value

MessageQueryInterface

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

{@inheritDoc}

Parameters

int $limit
int $page

Return Value

MessageQueryInterface

int|null getLimit()

{@inheritDoc}

Return Value

int|null

MessageQueryInterface setLimit(int $limit)

{@inheritDoc}

Parameters

int $limit

Return Value

MessageQueryInterface

int getPage()

{@inheritDoc}

Return Value

int

MessageQueryInterface setPage(int $page)

{@inheritDoc}

Parameters

int $page

Return Value

MessageQueryInterface

bool isFetchingBody()

{@inheritDoc}

Return Value

bool

bool isFetchingFlags()

{@inheritDoc}

Return Value

bool

bool isFetchingHeaders()

{@inheritDoc}

Return Value

bool

bool isFetchingSize()

{@inheritDoc}

Return Value

bool

MessageQueryInterface withFlags()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface withHeaders()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface withoutBody()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface withoutHeaders()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface withoutFlags()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface withoutSize()

{@inheritDoc}

Return Value

MessageQueryInterface

protected MessageQueryInterface setFetchFlags(bool $fetchFlags)

Set whether to fetch the flags.

Parameters

bool $fetchFlags

Return Value

MessageQueryInterface

protected MessageQueryInterface setFetchBody(bool $fetchBody)

Set the fetch body flag.

Parameters

bool $fetchBody

Return Value

MessageQueryInterface

protected MessageQueryInterface setFetchHeaders(bool $fetchHeaders)

Set whether to fetch the headers.

Parameters

bool $fetchHeaders

Return Value

MessageQueryInterface

protected MessageQueryInterface setFetchSize(bool $fetchSize)

Set whether to fetch the size.

Parameters

bool $fetchSize

Return Value

MessageQueryInterface

MessageQueryInterface setFetchOrder(string $fetchOrder)

{@inheritDoc}

Parameters

string $fetchOrder

Return Value

MessageQueryInterface

string getFetchOrder()

{@inheritDoc}

Return Value

string

MessageQueryInterface setFetchOrderAsc()

{@inheritDoc}

Return Value

MessageQueryInterface

MessageQueryInterface setFetchOrderDesc()

{@inheritDoc}

Return Value

MessageQueryInterface

__construct(FakeFolder $folder, ImapQueryBuilder $query = new ImapQueryBuilder())

Constructor.

Parameters

FakeFolder $folder
ImapQueryBuilder $query

MessageCollection get()

Get the messages matching the current query.

Return Value

MessageCollection

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

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