Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.06 KB

File metadata and controls

23 lines (16 loc) · 1.06 KB

Filter

This class is specifically intended to filter a library section, but could be used for other purposes. Objects are immutable as there are no publicly available properties or setter methods. Filters matches case-insensitive results.

Function List

Visibility Function (parameters,...): return
public __construct(string $field, string $value, string $operator = '='): void
public __toString(): string
Convert the object to a string

Examples

The field parameter in the constructor can accept, title, studio, year, rating, contentRating. Any other value will throw an Exception

Searching for George of the Jungle

$filter1 = new Filter('title', 'George');
$filter2 = new Filter('year', 1997, ">=");
$res = $api->filter(1, [$filter1, $filter2], true);
// Returns any movie with George in the title and released in or after 1997