interface ZoneChangeRequestRepositoryInterface (View source)

Persistence for zone change requests. Lists come back newest first.

Filters accepted by list() and count(): "status" (string), "zoneIds" (list|null, null means every zone and [] means none), "requesterId" (int), and "reviewableZoneIds" with "orRequesterId" for rows in those zones or filed by that user.

Methods

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

bool
isAvailable()

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

int
countPending(array|null $zoneIds)

No description

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
storeSnapshot(int $id, string $snapshot)

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

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

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

bool isAvailable()

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

Return Value

bool

int countPending(array|null $zoneIds)

No description

Parameters

array|null $zoneIds

null for every zone, [] for none

Return Value

int

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

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