src/PipelinerSales/ApiClient/Query/Criteria.php
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]);
                }
            }
        }
    }
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]);
                }
            }
        }
    }
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 ] ) ; } } } }
Sets multiple parameters at once.

@param mixed $criteria Can be one of the following:
<ul>
<li>Another Criteria object - copies that object's criteria into this one.
Competely replaces the current object's values, unsetting those which have not been
set in $criteria</li>
<li>An array - sets the parameters present in the array. Parameters not present
in the array will <b>not</b> be unset. If you wish to unset certain parameters,
set them to null in the array.</li>
<li>A string - the resulting query string (without a leading question mark),
will be parsed back into the individual parameters and processed like an array.</li>
</ul>
Sets multiple parameters at once .