Skip to content

Commit

Permalink
feat(HyperRequest): Add clone to quickly copy HyperRequests
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Jul 16, 2021
1 parent 3f4dfd1 commit e280d38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -521,6 +521,16 @@ A convenience method to not throw on errors.
| ------------ | ---- | -------- | ------- | ----------- |
| No arguments | | | | |

##### `clone`

Clones the current request into a new HyperRequest.

| Name | Type | Required | Default | Description |
| ------------ | ---- | -------- | ------- | ----------- |
| No arguments | | | | |

Returns: A new HyperRequest instance cloned from this one.

##### `setProperties`

Quickly set many request properties using a struct. The key should be the name
Expand Down
5 changes: 5 additions & 0 deletions models/HyperRequest.cfc
Expand Up @@ -662,6 +662,11 @@ component accessors="true" {
return this;
}

/**
* Clones the current request into a new HyperRequest.
*
* @returns A new HyperRequest instance cloned from this one.
*/
public HyperRequest function clone() {
var req = new HyperRequest();
req.setInterceptorService( variables.interceptorService );
Expand Down

0 comments on commit e280d38

Please sign in to comment.