public function constrain($query, $model, $strict = false)
    {
        if ($model === '*') {
            return $this->constrainByWildcard($query);
        }

        $model = is_string($model) ? new $model : $model;

        $this->constrainByModel($query, $model, $strict);
    }