MphpD
v1.2.2 Documentation GitHub

# 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

- ##### $tag

  Tag to be searched for. Like artist, title,...

- ##### $operator

  Comparison operator. Like ==, contains, ~=,...

- ##### $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

- ##### $tag

- ##### $operator

- ##### $value

#### Returns `FloFaber\MphpD\Filter`

$this

### __toString

Generate and return the Filter string.

    Filter::__toString() : string

#### Parameters

None.

#### Returns `string`

string

© 2023 Florian Faber