class ImapQueryBuilder (View source)

Properties

protected array $wheres

The where conditions for the query.

protected string $dateFormat

The date format to use for date based queries.

Methods

all()

Add a where "ALL" clause to the query.

new()

Add a where "NEW" clause to the query.

old()

Add a where "OLD" clause to the query.

seen()

Add a where "SEEN" clause to the query.

draft()

Add a where "DRAFT" clause to the query.

recent()

Add a where "RECENT" clause to the query.

unseen()

Add a where "UNSEEN" clause to the query.

flagged()

Add a where "FLAGGED" clause to the query.

deleted()

Add a where "DELETED" clause to the query.

answered()

Add a where "ANSWERED" clause to the query.

undeleted()

Add a where "UNDELETED" clause to the query.

unflagged()

Add a where "UNFLAGGED" clause to the query.

unanswered()

Add a where "UNANSWERED" clause to the query.

from(string $email)

Add a where "FROM" clause to the query.

to(string $value)

Add a where "TO" clause to the query.

cc(string $value)

Add a where "CC" clause to the query.

bcc(string $value)

Add a where "BCC" clause to the query.

body(string $value)

Add a where "BODY" clause to the query.

keyword(string $value)

Add a where "KEYWORD" clause to the query.

on(mixed $date)

Add a where "ON" clause to the query.

since(mixed $date)

Add a where "SINCE" clause to the query.

before(mixed $value)

Add a where "BEFORE" clause to the query.

subject(string $value)

Add a where "SUBJECT" clause to the query.

text(string $value)

Add a where "TEXT" clause to the query.

header(string $header, string $value)

Add a where "HEADER" clause to the query.

uid(int|string|array $from, int|float|null $to = null)

Add a where "UID" clause to the query.

where(mixed $column, mixed $value = null)

Add a "where" condition.

orWhere(mixed $column, mixed $value = null)

Add an "or where" condition.

whereNot(mixed $column, mixed $value = null)

Add a "where not" condition.

bool
isEmpty()

Determine if the query has any where conditions.

string
toImap()

Transform the instance into an IMAP-compatible query string.

newQuery()

Create a new query instance (like Eloquent's newQuery).

void
addBasicCondition(string $boolean, mixed $column, mixed $value, bool $not = false)

Add a basic condition to the query.

RawQueryValue|string|null
prepareWhereValue(mixed $value)

Prepare the where value, escaping it as needed.

void
addNestedCondition(string $boolean, callable $callback)

Add a nested condition group to the query.

CarbonInterface
parseDate(mixed $date)

Attempt to parse a date string into a Carbon instance.

array
makeExpressionNode(array $where)

Build a single expression node from a basic or nested where.

string
mergeExpressions(string $existing, string $next, string $boolean)

Merge the existing expression with the next expression, respecting the boolean operator.

string
compileWheres(array $wheres)

Recursively compile the wheres array into an IMAP-compatible string.

string
compileBasic(array $where)

Compile a basic where condition into an IMAP-compatible string.

Details

ImapQueryBuilder all()

Add a where "ALL" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder new()

Add a where "NEW" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder old()

Add a where "OLD" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder seen()

Add a where "SEEN" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder draft()

Add a where "DRAFT" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder recent()

Add a where "RECENT" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder unseen()

Add a where "UNSEEN" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder flagged()

Add a where "FLAGGED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder deleted()

Add a where "DELETED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder answered()

Add a where "ANSWERED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder undeleted()

Add a where "UNDELETED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder unflagged()

Add a where "UNFLAGGED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder unanswered()

Add a where "UNANSWERED" clause to the query.

Return Value

ImapQueryBuilder

ImapQueryBuilder from(string $email)

Add a where "FROM" clause to the query.

Parameters

string $email

Return Value

ImapQueryBuilder

ImapQueryBuilder to(string $value)

Add a where "TO" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder cc(string $value)

Add a where "CC" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder bcc(string $value)

Add a where "BCC" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder body(string $value)

Add a where "BODY" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder keyword(string $value)

Add a where "KEYWORD" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder on(mixed $date)

Add a where "ON" clause to the query.

Parameters

mixed $date

Return Value

ImapQueryBuilder

ImapQueryBuilder since(mixed $date)

Add a where "SINCE" clause to the query.

Parameters

mixed $date

Return Value

ImapQueryBuilder

ImapQueryBuilder before(mixed $value)

Add a where "BEFORE" clause to the query.

Parameters

mixed $value

Return Value

ImapQueryBuilder

ImapQueryBuilder subject(string $value)

Add a where "SUBJECT" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder text(string $value)

Add a where "TEXT" clause to the query.

Parameters

string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder header(string $header, string $value)

Add a where "HEADER" clause to the query.

Parameters

string $header
string $value

Return Value

ImapQueryBuilder

ImapQueryBuilder uid(int|string|array $from, int|float|null $to = null)

Add a where "UID" clause to the query.

Parameters

int|string|array $from
int|float|null $to

Return Value

ImapQueryBuilder

ImapQueryBuilder where(mixed $column, mixed $value = null)

Add a "where" condition.

Parameters

mixed $column
mixed $value

Return Value

ImapQueryBuilder

ImapQueryBuilder orWhere(mixed $column, mixed $value = null)

Add an "or where" condition.

Parameters

mixed $column
mixed $value

Return Value

ImapQueryBuilder

ImapQueryBuilder whereNot(mixed $column, mixed $value = null)

Add a "where not" condition.

Parameters

mixed $column
mixed $value

Return Value

ImapQueryBuilder

bool isEmpty()

Determine if the query has any where conditions.

Return Value

bool

string toImap()

Transform the instance into an IMAP-compatible query string.

Return Value

string

protected ImapQueryBuilder newQuery()

Create a new query instance (like Eloquent's newQuery).

Return Value

ImapQueryBuilder

protected void addBasicCondition(string $boolean, mixed $column, mixed $value, bool $not = false)

Add a basic condition to the query.

Parameters

string $boolean
mixed $column
mixed $value
bool $not

Return Value

void

protected RawQueryValue|string|null prepareWhereValue(mixed $value)

Prepare the where value, escaping it as needed.

Parameters

mixed $value

Return Value

RawQueryValue|string|null

protected void addNestedCondition(string $boolean, callable $callback)

Add a nested condition group to the query.

Parameters

string $boolean
callable $callback

Return Value

void

protected CarbonInterface parseDate(mixed $date)

Attempt to parse a date string into a Carbon instance.

Parameters

mixed $date

Return Value

CarbonInterface

protected array makeExpressionNode(array $where)

Build a single expression node from a basic or nested where.

Parameters

array $where

Return Value

array

protected string mergeExpressions(string $existing, string $next, string $boolean)

Merge the existing expression with the next expression, respecting the boolean operator.

Parameters

string $existing
string $next
string $boolean

Return Value

string

protected string compileWheres(array $wheres)

Recursively compile the wheres array into an IMAP-compatible string.

Parameters

array $wheres

Return Value

string

protected string compileBasic(array $where)

Compile a basic where condition into an IMAP-compatible string.

Parameters

array $where

Return Value

string