trait EnforcesPermissionPartition

Properties

protected PermissionRegistrar $permissionPartitionRegistrar
protected PermissionRelationContext $permissionRelationContext

Methods

void
initializePermissionPartitionRelation(PermissionRegistrar $registrar, PermissionRelationContext $context)

Initialize the permission partition relation state.

getPermissionRelationContext()

Get the relation's captured permission context.

getPivotConnection()

Get the connection that owns permission pivots.

array
formatAttachRecord(int|string $key, mixed $value, array $attributes, bool $hasTimestamps)

Format an attachment record without allowing partition overrides.

int
updateExistingPivot(mixed $id, array $attributes, bool $touch = true)

Update an existing pivot without allowing partition movement.

int
detach(mixed $ids = null, bool $touch = true)

Detach pivot records within the captured permission context.

getResults()

Get and mark lazily loaded relation results.

array
initRelation(array $models, string $relation)

Initialize and mark eager-loaded relation collections.

array
match(array $models, Collection $results, string $relation)

Match and mark eager-loaded relation collections.

void
ensurePivotMatchesPermissionPartition(array $attributes)

Reject conflicting caller-supplied partition attributes.

void
markPermissionRelationCollections(array $models, string $relation)

Mark the loaded collection attached to each eager-loaded model.

Details

at line 24
protected void initializePermissionPartitionRelation(PermissionRegistrar $registrar, PermissionRelationContext $context)

Initialize the permission partition relation state.

Parameters

PermissionRegistrar $registrar
PermissionRelationContext $context

Return Value

void

at line 35
PermissionRelationContext getPermissionRelationContext()

Get the relation's captured permission context.

at line 43
protected ConnectionInterface getPivotConnection()

Get the connection that owns permission pivots.

Return Value

ConnectionInterface

at line 51
protected array formatAttachRecord(int|string $key, mixed $value, array $attributes, bool $hasTimestamps)

Format an attachment record without allowing partition overrides.

Parameters

int|string $key
mixed $value
array $attributes
bool $hasTimestamps

Return Value

array

at line 76
int updateExistingPivot(mixed $id, array $attributes, bool $touch = true)

Update an existing pivot without allowing partition movement.

Parameters

mixed $id
array $attributes
bool $touch

Return Value

int

at line 94
int detach(mixed $ids = null, bool $touch = true)

Detach pivot records within the captured permission context.

Parameters

mixed $ids
bool $touch

Return Value

int

at line 104
Collection getResults()

Get and mark lazily loaded relation results.

Return Value

Collection

at line 126
array initRelation(array $models, string $relation)

Initialize and mark eager-loaded relation collections.

Parameters

array $models
string $relation

Return Value

array

at line 140
array match(array $models, Collection $results, string $relation)

Match and mark eager-loaded relation collections.

Parameters

array $models
Collection $results
string $relation

Return Value

array

at line 151
protected void ensurePivotMatchesPermissionPartition(array $attributes)

Reject conflicting caller-supplied partition attributes.

Parameters

array $attributes

Return Value

void

at line 180
protected void markPermissionRelationCollections(array $models, string $relation)

Mark the loaded collection attached to each eager-loaded model.

Parameters

array $models
string $relation

Return Value

void