final class DbZoneChangeRequestRepository implements ZoneChangeRequestRepositoryInterface (View source)

SQL persistence for zone_change_requests, a Poweradmin-native table that is never prefixed and is shared by the SQL and API backends. Until the 4.6.0 schema update creates it, reads find nothing and writes fail.

Constants

private COLUMNS

Methods

__construct(PDO $db, LoggerInterface|null $logger = null)

No description

bool
isAvailable()

False until the 4.6.0 schema update has created the requests table.

int
create(int $zoneId, string $zoneName, string $kind, int|null $requesterId, string $requesterName, string|null $requestComment, string|null $baseSerial, array $actions, string|null $zoneComment)

No description

find(int $id)

No description

array
list(array $filters, int $offset, int $limit)

No description

int
count(array $filters)

No description

array
listPending(array|null $zoneIds, int $offset, int $limit)

No description

array
listPendingForZone(int $zoneId)

No description

int
countPending(array|null $zoneIds)

No description

void
storeSnapshot(int $id, string $snapshot)

Keeps a copy of the zone (a BIND zone file) taken before an approved deletion.

array
countPendingByZone(array $zoneIds, array|null $reviewableZoneIds, int $requesterId)

Pending requests per zone, for the zones that have any, counting only the requests the user may list: those in the zones they review or their own.

bool
markReviewed(int $id, string $status, int $reviewerId, string $reviewerName, string|null $comment, array $fromStatuses = [ZoneChangeRequest::STATUS_PENDING])

No description

void
markApplied(int $id)

No description

void
markFailed(int $id, string $error)

No description

bool
cancel(int $id)

No description

int
cancelOpenForDeletedZone(int $zoneId, string $reason)

Cancels the zone's pending and failed requests once the zone is deleted, since a later zone can be given the same id and would inherit them.

Details

__construct(PDO $db, LoggerInterface|null $logger = null)

No description

Parameters

PDO $db
LoggerInterface|null $logger

bool isAvailable()

False until the 4.6.0 schema update has created the requests table.

Return Value

bool

int create(int $zoneId, string $zoneName, string $kind, int|null $requesterId, string $requesterName, string|null $requestComment, string|null $baseSerial, array $actions, string|null $zoneComment)

No description

Parameters

int $zoneId
string $zoneName
string $kind
int|null $requesterId
string $requesterName
string|null $requestComment
string|null $baseSerial
array $actions
string|null $zoneComment

Return Value

int

The new request id

ZoneChangeRequest|null find(int $id)

No description

Parameters

int $id

Return Value

ZoneChangeRequest|null

array list(array $filters, int $offset, int $limit)

No description

Parameters

array $filters
int $offset
int $limit

Return Value

array

int count(array $filters)

No description

Parameters

array $filters

Return Value

int

array listPending(array|null $zoneIds, int $offset, int $limit)

No description

Parameters

array|null $zoneIds

null for every zone, [] for none

int $offset
int $limit

Return Value

array

array listPendingForZone(int $zoneId)

No description

Parameters

int $zoneId

Return Value

array

int countPending(array|null $zoneIds)

No description

Parameters

array|null $zoneIds

null for every zone, [] for none

Return Value

int

void storeSnapshot(int $id, string $snapshot)

Keeps a copy of the zone (a BIND zone file) taken before an approved deletion.

Parameters

int $id
string $snapshot

Return Value

void

array countPendingByZone(array $zoneIds, array|null $reviewableZoneIds, int $requesterId)

Pending requests per zone, for the zones that have any, counting only the requests the user may list: those in the zones they review or their own.

Parameters

array $zoneIds
array|null $reviewableZoneIds

null for every zone

int $requesterId

Return Value

array

zone id => pending count

bool markReviewed(int $id, string $status, int $reviewerId, string $reviewerName, string|null $comment, array $fromStatuses = [ZoneChangeRequest::STATUS_PENDING])

No description

Parameters

int $id
string $status
int $reviewerId
string $reviewerName
string|null $comment
array $fromStatuses

The states the request may be in for the decision to take

Return Value

bool

False when the request was in none of them, so nothing changed

void markApplied(int $id)

No description

Parameters

int $id

Return Value

void

void markFailed(int $id, string $error)

No description

Parameters

int $id
string $error

Return Value

void

bool cancel(int $id)

No description

Parameters

int $id

Return Value

bool

False when the request was no longer pending, so nothing changed

int cancelOpenForDeletedZone(int $zoneId, string $reason)

Cancels the zone's pending and failed requests once the zone is deleted, since a later zone can be given the same id and would inherit them.

Parameters

int $zoneId
string $reason

Return Value

int

The number of requests cancelled