Adds a filter to the query

@param   mixed   $name
@param   array   $query
@param   string  $tag
@return  object
547927
public function addFilter($name, $query = array(), $tag = 'root_type')
	{
		$this->adapter->addFilter($name, $query, $tag);
		return $this;
	}
858889
public function queryFromFilter(Query $query, array $data = [])
    {
        $query = parent::queryFromFilter($query, $data);

        //"Name" field
        if (!empty($data['name']) && strlen($data['name']) > 2) {
            $query->where([sprintf('%s.tag LIKE', $this->getAlias()) => sprintf('%%%s%%', $data['name'])]);
        }

        return $query;
    }
737203
public function scopeWithAnyTags(Builder $query, $tags)
    {
        $tags = static::convertToTags($tags);

        return $query->whereHas('tags', function (Builder $query) use ($tags) {
            $tagIds = $tags->pluck('id')->toArray();

            $query->whereIn('taggables.tag_id', $tagIds);
        });
    }
714082
public static function tag( $name, $param1 = null, $param2 = null ) 
	{
		return static::create( $name, $param1, $param2 );
	}
1090257
public function filterByTags($tags)
    {
        $this->query->andWhere(
            $this->query->expr()->andX(
                $this->query->expr()->like('fv.fvTags', ':tags')
            )
        );
        $this->query->setParameter('tags', '%' . $tags . '%');
    }
547115
public function addFilter($classname, $query)
    {
        $filterClass = is_object($classname) ? get_class($classname) : $classname;
        if (!class_exists($filterClass)) {
            return $this;
        }
        $filter = str_slug(class_basename($filterClass));
        $path   = uri();
        $this->dispatcher->fire("datatables:filters.{$path}.{$filter}.before", [$this->filterAdapter, $query]);
        $this->dispatcher->fire(new BeforeFilters($path, $filter, $this->filterAdapter, $query));
        $this->filterAdapter->add($classname);
        $this->dispatcher->fire("datatables:filters.{$path}.{$filter}.after", [$this->filterAdapter, $query]);
        $this->dispatcher->fire(new AfterFilters($path, $filter, $this->filterAdapter, $query));
        return $this;
    }
108923
public function findByTag($tag)
    {
        return $this->createQueryBuilder('p')
            ->join('p.tags', 't')
            ->where('p.active = true')
            ->andWhere('t.name = :name')
            ->setParameter('name', $tag)
            ->orderBy('p.datePublished', 'DESC')
            ->getQuery()
            ->getResult();
    }
709502
public OverpassFilterQuery tagMultiple(String name, Set<String> values) {
        builder.multipleValues(name, values);

        return this;
    }
595495
public function permitTag($name)
    {
        $key = array_search($name, $this->ignoredTags);

        if ($key !== false) {
            unset($this->ignoredTags[$key]);
        }
    }
942726
public function scopeWithTags($query, $tags)
    {
        $tags = $this->makeTagsArray($tags);

        foreach ($tags as $tag)
            $this->scopeWithTag($query, $tag);

        return $query;
    }
267232
public static function scopeWhereTag(Builder $query, $tags, $type = 'slug')
    {
        $tags = (new static())->prepareTags($tags);

        foreach ($tags as $tag) {
            $query->whereHas('tags', function ($query) use ($type, $tag) {
                $query->where($type, $tag);
            });
        }

        return $query;
    }
925413
public function create($name)
    {
        $params = array(
            "tag" => array(
                "name" => $name
            )
        );
        $rst = $this->_request->post($this->_url . 'tags/create', $params);
        return $this->_client->rst($rst);
    }
1199936
public function findByGenericFilter($name, $filter = null, $page = 1, $orderColumn = null, $orderType = null) {
        $this->load();
        $mapper = MapperBuilder::buildFromName($this->mapping, $name);

        $selectQuery = "";
        $whereQuery = "";
        $orderQuery = "";

        $selectQuery .= "SELECT * FROM `" . $mapper->getTable() . "` ";
        $filterList = array();
        if (!is_null($filter)) {
            $filterList = explode(" ", $filter);
        }

        if (!is_null($filter)) {
            $whereQuery .= " WHERE 1=2 ";
            foreach ($filterList as $searchedWord) {
                foreach ($mapper->getFilter("generic")->getColumns() as $filteredColumn) {
                    $whereQuery .= " OR $filteredColumn LIKE '%" . $searchedWord . "%'";
                }
            }
        } else {
            $whereQuery .= " WHERE 1 ";
        }

        if (!is_null($orderColumn)) {
            $orderQuery .= "ORDER BY $orderColumn ";
            if (!is_null($orderType)) {
                $orderQuery .= "$orderType";
            } else {
                $orderQuery .= "ASC";
            }
        }

        $from = ($page - 1) * $mapper->getFilter("generic")->getItemsPerPage();
        $pageQuery = " LIMIT $from , " . $mapper->getFilter("generic")->getItemsPerPage();

        $query = $selectQuery . $whereQuery . $orderQuery . $pageQuery;
        $result = $this->getDataSource()->query($query);

        if ($result) {
            $collection = new Collection($mapper->getClass(), $result, $mapper);
        } else {
            $collection = new Collection($mapper->getClass(), array(), $mapper);
        }

        $selectCountQuery = "SELECT count(*) as total FROM `" . $mapper->getTable() . "` ";
        $query = $selectCountQuery . $whereQuery;
        $result = $this->getDataSource()->query($query);
        $itemCount = $result[0]["total"];
        $pager = new Pager($collection, $itemCount, $mapper->getFilter("generic")->getItemsPerPage(), $page);

        return $pager;
    }
473824
protected function search_form($query = '', $tagcollid = 0) {
        $searchurl = new moodle_url('/tag/search.php');
        $output = '<form action="' . $searchurl . '">';
        $output .= '<label class="accesshide" for="searchform_query">' . get_string('searchtags', 'tag') . '</label>';
        $output .= '<input id="searchform_query" name="query" type="text" size="40" value="' . s($query) . '" />';
        $tagcolls = core_tag_collection::get_collections_menu(false, true, get_string('inalltagcoll', 'tag'));
        if (count($tagcolls) > 1) {
            $output .= '<label class="accesshide" for="searchform_tc">' . get_string('selectcoll', 'tag') . '</label>';
            $output .= html_writer::select($tagcolls, 'tc', $tagcollid, null, array('id' => 'searchform_tc'));
        }
        $output .= '<input name="go" type="submit" size="40" value="' . s(get_string('search', 'tag')) . '" />';
        $output .= '</form>';

        return $output;
    }
935723
public function addTag(string $name, string $fg = '', string $bg = '', array $options = [])
    {
        $this->tags[$name] = Color::make($fg, $bg, $options);
    }
693395
public static function filterTag(Tag $tag, Parser $parser, array $tagsConfig, array $openTags)
	{
		$tagName   = $tag->getName();
		$tagConfig = $tagsConfig[$tagName];

		// Record the tag being processed into the logger it can be added to the context of
		// messages logged during the execution
		$logger = $parser->getLogger();
		$logger->setTag($tag);

		// Prepare the variables that are accessible to filters
		$vars = [
			'logger'         => $logger,
			'openTags'       => $openTags,
			'parser'         => $parser,
			'registeredVars' => $parser->registeredVars,
			'tag'            => $tag,
			'tagConfig'      => $tagConfig,
			'text'           => $parser->getText()
		];
		foreach ($tagConfig['filterChain'] as $filter)
		{
			if ($tag->isInvalid())
			{
				break;
			}
			self::executeFilter($filter, $vars);
		}

		// Remove the tag from the logger
		$logger->unsetTag();
	}
252608
public static function filter($name, $handler)
    {
        if (! $handler instanceof \Closure and ! in_array(Filter::class, class_implements($handler), false)) {
            throw new \InvalidArgumentException("Failed adding Filter. Provided handler for [{$name}] is not valid. Must either provide a \\Closure or classpath that impelments \\Docit\\Docit\\Contracts\\Filter");
        }

        static::$filters[ $name ] = $handler;
    }