Hootlex\Moderation\ModerationScope::remove PHP Метод

remove() публичный Метод

(This method exists in order to achieve compatibility with laravel 5.1.*)
public remove ( Builder $builder, Model $model ) : void
$builder Illuminate\Database\Eloquent\Builder
$model Illuminate\Database\Eloquent\Model
Результат void
    public function remove(Builder $builder, Model $model)
    {
        $column = $model->getQualifiedStatusColumn();
        $query = $builder->getQuery();
        $bindingKey = 0;
        foreach ((array) $query->wheres as $key => $where) {
            if ($this->isModerationConstraint($where, $column)) {
                $this->removeWhere($query, $key);
                // Here SoftDeletingScope simply removes the where
                // but since we use Basic where (not Null type)
                // we need to get rid of the binding as well
                $this->removeBinding($query, $bindingKey);
            }
            // Check if where is either NULL or NOT NULL type,
            // if that's the case, don't increment the key
            // since there is no binding for these types
            if (!in_array($where['type'], ['Null', 'NotNull'])) {
                $bindingKey++;
            }
        }
    }