Plank\Mediable\Mediable::scopeWhereHasMediaMatchAll PHP Метод

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

Query scope to detect the presence of one or more attached media that is bound to all of the specified tags simultaneously.
public scopeWhereHasMediaMatchAll ( Builder $q, array $tags ) : void
$q Illuminate\Database\Eloquent\Builder
$tags array
Результат void
    public function scopeWhereHasMediaMatchAll(Builder $q, array $tags)
    {
        $grammar = $q->getConnection()->getQueryGrammar();
        $subquery = $this->newMatchAllQuery($tags)->selectRaw('count(*)')->whereRaw($grammar->wrap($this->media()->getForeignKey()) . ' = ' . $grammar->wrap($this->getQualifiedKeyName()));
        $q->whereRaw('(' . $subquery->toSql() . ') >= 1', $subquery->getBindings());
    }