src/Collections/PopoloCollection.php
public function filter($filters)
    {
        $filtered = [];
        foreach ($this->objectArr as $obj) {
            $success = true;
            foreach ($filters as $prop => $value) {
                if ($obj->$prop !== $value) {
                    $success = false;
                    break;
                }
            }
            if ($success) {
                $filtered[] = $obj;
            }
        }
        return $filtered;
    }
public function filter($filters)
    {
        $filtered = [];
        foreach ($this->objectArr as $obj) {
            $success = true;
            foreach ($filters as $prop => $value) {
                if ($obj->$prop !== $value) {
                    $success = false;
                    break;
                }
            }
            if ($success) {
                $filtered[] = $obj;
            }
        }
        return $filtered;
    }
public function filter ( $ filters ) { $ filtered = [ ] ; foreach ( $ this -> objectArr as $ obj ) { $ success = true ; foreach ( $ filters as $ prop => $ value ) { if ( $ obj -> $ prop !== $ value ) { $ success = false ; break ; } } if ( $ success ) { $ filtered [ ] = $ obj ; } } return $ filtered ; }
Gets an array of matching items, according to the
array of filters provided. Filters are key-value pairs
that are ANDed together, i.e. returned items match all
the criteria

@param string[] $filters key-value set of criteria

@return object[]
Gets an array of matching items according to the array of filters provided . Filters are key - value pairs that are ANDed together i . e . returned items match all the criteria