ApiOpenStudio PHPDoc

InviteMapper extends Mapper
in package

Class InviteMapper.

Mapper class for DB calls used for the invite table.

Table of Contents

$db  : ADOConnection
DB connector.
$logger  : MonologWrapper
Logger object.
__construct()  : mixed
Mapper constructor.
delete()  : bool
Delete an invite.
findAll()  : array<string|int, mixed>
Find an invite by ID.
findByEmail()  : Invite
Find an invite by email.
findByEmailToken()  : Invite
Find an invite by email and token.
findByIid()  : Invite
Find an invite by ID.
findByToken()  : Invite
Find an invite by token.
save()  : bool
Save an Invite.
fetchRow()  : mixed
Perform an SQL statement that expects a single row.
fetchRows()  : array<string|int, mixed>
Perform an SQL statement that expects multiple rows.
mapArray()  : Invite
Map a DB row into an Invite object.
saveDelete()  : bool
Perform a save or delete.

Properties

$db

DB connector.

protected ADOConnection $db

DB Instance.

Methods

__construct()

Mapper constructor.

public __construct(ADOConnection $dbLayer, MonologWrapper $logger) : mixed
Parameters
$dbLayer : ADOConnection

DB connection object.

$logger : MonologWrapper

Logger object.

Return values
mixed

delete()

Delete an invite.

public delete(Invite $invite) : bool
Parameters
$invite : Invite

Invite object.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
bool

Success.

findAll()

Find an invite by ID.

public findAll(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Filter params.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
array<string|int, mixed>

Array of invites.

findByEmail()

Find an invite by email.

public findByEmail(string $email) : Invite
Parameters
$email : string

Invite email.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
Invite

Array of Invite.

findByEmailToken()

Find an invite by email and token.

public findByEmailToken(string $email, string $token) : Invite
Parameters
$email : string

Invite email.

$token : string

Invite token.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
Invite

Invite object.

findByIid()

Find an invite by ID.

public findByIid(int $iid) : Invite
Parameters
$iid : int

Invite ID.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
Invite

Invite object.

findByToken()

Find an invite by token.

public findByToken(string $token) : Invite
Parameters
$token : string

Invite token.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
Invite

Invite object.

save()

Save an Invite.

public save(Invite $invite) : bool
Parameters
$invite : Invite

Invite object.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
bool

Success.

fetchRow()

Perform an SQL statement that expects a single row.

protected fetchRow(string $sql, array<string|int, mixed> $bindParams) : mixed
Parameters
$sql : string

Query string.

$bindParams : array<string|int, mixed>

Array of bind params.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
mixed

Mapped row.

fetchRows()

Perform an SQL statement that expects multiple rows.

protected fetchRows(string $sql[, array<string|int, mixed> $bindParams = [] ][, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$sql : string

Query string.

$bindParams : array<string|int, mixed> = []

Array of bind params.

$params : array<string|int, mixed> = []

Parameters (optional). Example: [ 'filter' => [ 'keyword' => string, 'column' => string, ] 'order_by' => string, 'direction' => string "ASC"|"DESC", 'offset' => int, 'limit' => int, ] NOTE: * This will throw an exception if the sql already contains a WHERE clause and should be calculated separately in these cases. * ['filter']['keyword'] '%' characters in keyword not added to keyword automatically.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
array<string|int, mixed>

Array of mapped rows.

mapArray()

Map a DB row into an Invite object.

protected mapArray(array<string|int, mixed> $row) : Invite
Parameters
$row : array<string|int, mixed>

DB row object.

Return values
Invite

Invite object.

saveDelete()

Perform a save or delete.

protected saveDelete(string $sql, array<string|int, mixed> $bindParams) : bool
Parameters
$sql : string

Query string.

$bindParams : array<string|int, mixed>

Array of bind params.

Tags
throws
ApiException

Return an ApiException on DB error.

Return values
bool

Success status.

Search results