PHP Class Nanigans\SingleTableInheritance\SingleTableInheritanceScope

Inheritance: implements Illuminate\Database\Eloquent\ScopeInterface
Show file Open project: nanigans/single-table-inheritance

Public Methods

Method Description
apply ( Builder $builder, Model $model ) : void Apply the scope to a given Eloquent query builder.
remove ( Builder $builder, Model $model ) : void Remove the scope from the given Eloquent query builder.

Protected Methods

Method Description
isSingleTableInheritanceConstraint ( array $where, string $column ) : boolean Determine if the given where clause is a single table inheritance constraint.

Method Details

apply() public method

Apply the scope to a given Eloquent query builder.
public apply ( Builder $builder, Model $model ) : void
$builder Illuminate\Database\Eloquent\Builder
$model Illuminate\Database\Eloquent\Model
return void

isSingleTableInheritanceConstraint() protected method

Determine if the given where clause is a single table inheritance constraint.
protected isSingleTableInheritanceConstraint ( array $where, string $column ) : boolean
$where array
$column string
return boolean

remove() public method

Remove the scope from the given Eloquent query builder.
public remove ( Builder $builder, Model $model ) : void
$builder Illuminate\Database\Eloquent\Builder
$model Illuminate\Database\Eloquent\Model
return void