public static function createFromArray(array $values)
    {
        $collection = new self();

        foreach ($values as $key => $value) {
            $collection->set($key, $value);
        }

        return $collection;
    }
public static function createFromArray(array $values)
    {
        $collection = new self();

        foreach ($values as $key => $value) {
            $collection->set($key, $value);
        }

        return $collection;
    }
public static function createFromArray ( array $ values ) { $ collection = new self ( ) ; foreach ( $ values as $ key => $ value ) { $ collection -> set ( $ key , $ value ) ; } return $ collection ; }
Factory method to construct a new collection

@throws ClientException

@param array $values - initial values for collection

@return Collection
Factory method to construct a new collection