ZoneOwnershipRepositoryInterface
interface ZoneOwnershipRepositoryInterface (View source)
Zone ownership reads and writes; one of the three roles ZoneRepositoryInterface combines.
Methods
Get users who own a zone
Direct owners of several zones in one query, for list pages.
Ids of every zone the user owns directly or through a group, in the id space the zone logs and zones_groups use.
Lock the zone's owner rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale owner counts.
Add owner to zone
Give the named zone row a user being deleted holds to another user, so the zone stays.
Remove owner from zone
Check if user is already an owner of the zone
Whether two zones share this zone id in API backend mode, so owner rows and group grants keyed by it cannot tell the zones apart and are not honoured.
Details
array
getZoneOwners(int $zoneId)
Get users who own a zone
array
getOwnerIdsByZoneIds(array $zoneIds)
Direct owners of several zones in one query, for list pages.
array
getOwnedZoneIds(int $userId)
Ids of every zone the user owns directly or through a group, in the id space the zone logs and zones_groups use.
void
lockZoneOwners(int $zoneId)
Lock the zone's owner rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale owner counts.
bool
addOwnerToZone(int $zoneId, int $userId)
Add owner to zone
bool|null
handOverNamedZoneRow(int $zoneId, int $fromUserId, int $toUserId)
Give the named zone row a user being deleted holds to another user, so the zone stays.
Null when the backend keeps no such row or the user holds none (add an owner instead); false when the id is shared and the row it opens is not that user's.
bool
removeOwnerFromZone(int $zoneId, int $userId)
Remove owner from zone
bool
isUserZoneOwner(int $zoneId, int $userId)
Check if user is already an owner of the zone
bool
isSharedZoneId(int $zoneId)
Whether two zones share this zone id in API backend mode, so owner rows and group grants keyed by it cannot tell the zones apart and are not honoured.