public function set($criteria)
    {
        if ($criteria instanceof Criteria) {
            //this is much faster than using the same method that's used for arrays (see below)
            $this->limit = $criteria->limit;
            $this->offset = $criteria->offset;
            $this->sort = $criteria->sort;
            $this->filter = $criteria->filter;
            $this->after = $criteria->after;
            $this->loadonly = $criteria->loadonly;
        } elseif (is_string($criteria)) {
            //parse the string into an array and then parse the array
            $criteria = $this->parseHttpQuery($criteria);
        }

        if (is_array($criteria)) {
            foreach (self::$properties as $p => $setter) {
                if (isset($criteria[$p])) {
                    $this->$setter($criteria[$p]);
                }
            }
        }
    }