trait HasCustomerGroups (View source)

Traits

Methods

validateScheduling(Collection $models)

No description

void
schedule(Relation $relation, mixed $models, DateTime $starts = null, DateTime $ends = null, array $pivotData = [])

Schedule models for a given relation.

void
unschedule(Relation $relation, mixed $models, array $pivotData = [])

Unschedule models for a relation.

Relation
customerGroups()

Get the relationship for the customer groups.

void
scheduleCustomerGroup(mixed $models, DateTime $starts = null, DateTime $ends = null, array $pivotData = [])

Schedule models against customer groups.

void
unscheduleCustomerGroup(mixed $models, array $pivotData = [])

Unschedule models against a customer group.

Builder
applyCustomerGroupScope(Builder $query, Collection $groupIds, DateTime $startsAt, DateTime $endsAt)

Apply customer group scope.

Builder
scopeCustomerGroup(Builder $query, CustomerGroup|iterable $customerGroup = null, DateTime $startsAt = null, DateTime $endsAt = null)

Apply the customer group scope

Details

protected validateScheduling(Collection $models)

No description

Parameters

Collection $models

protected void schedule(Relation $relation, mixed $models, DateTime $starts = null, DateTime $ends = null, array $pivotData = [])

Schedule models for a given relation.

Parameters

Relation $relation
mixed $models
DateTime $starts
DateTime $ends
array $pivotData

Return Value

void

protected void unschedule(Relation $relation, mixed $models, array $pivotData = [])

Unschedule models for a relation.

Parameters

Relation $relation
mixed $models
array $pivotData

Return Value

void

abstract Relation customerGroups()

Get the relationship for the customer groups.

Return Value

Relation

void scheduleCustomerGroup(mixed $models, DateTime $starts = null, DateTime $ends = null, array $pivotData = [])

Schedule models against customer groups.

Parameters

mixed $models
DateTime $starts
DateTime $ends
array $pivotData

Return Value

void

void unscheduleCustomerGroup(mixed $models, array $pivotData = [])

Unschedule models against a customer group.

Parameters

mixed $models
array $pivotData

Return Value

void

Builder applyCustomerGroupScope(Builder $query, Collection $groupIds, DateTime $startsAt, DateTime $endsAt)

Apply customer group scope.

Parameters

Builder $query
Collection $groupIds
DateTime $startsAt
DateTime $endsAt

Return Value

Builder

Builder scopeCustomerGroup(Builder $query, CustomerGroup|iterable $customerGroup = null, DateTime $startsAt = null, DateTime $endsAt = null)

Apply the customer group scope

Parameters

Builder $query
CustomerGroup|iterable $customerGroup
DateTime $startsAt
DateTime $endsAt

Return Value

Builder