Filter

Filters provide a way to search for specific songs. They take care of parsing and escaping. They are used in various other methods like DB::search, Playlist::add_search and more. Refer to the MPD documentation for more information about filters.

new FloFaber\MphpD\Filter(string $tag, string $operator, string $value) : Filter

Methods

__construct

Creates a new filter.

Filter::__construct(string $tag, string $operator, string $value) : mixed

Parameters

@param string $tag Tag to be searched for. Like artist, title,...

@param string $operator Comparison operator. Like ==, contains, ~=,...

@param string $value The value to search for. Unescaped.

Returns mixed

and

Used to chain multiple filters together with a logical AND.

Filter::and(string $tag, string $operator, string $value) : FloFaber\MphpD\Filter

Parameters

@param string $tag

@param string $operator

@param string $value

Returns FloFaber\MphpD\Filter

$this

__toString

Generate and return the Filter string.

Filter::__toString() : string

Parameters

None.

Returns string

string

© 2023 Florian Faber