Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only user_id and scenario is required for UserRecommendation (#108)
- Loading branch information
1 parent
f9ff273
commit 87e1d4a
Showing
9 changed files
with
180 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Upgrading from 2.x to 3.0 | ||
|
||
API client release 2.0 contains few backward incompatible changes. | ||
|
||
This guide will help you upgrade your codebase. | ||
|
||
## `UserRecommendation::create()` now accepts only `$user_id` and `$scenario` | ||
`UserReccomentation::create()` accepts only two argumens: `$user_id` and `$scenario`. | ||
Both are arguments are required. Reccomendation command can be further parametrized | ||
using fluent API. | ||
|
||
#### Before | ||
```php | ||
$recommendation = UserRecommendation::create('user-id', 5, 'scenario', 1.0, 3600); | ||
``` | ||
|
||
#### After | ||
```php | ||
$recommendation = UserRecommendation::create('user-id', 'scenario') | ||
->setCount(5) | ||
->setRotationRate(1.0) | ||
->setRotationTime(3600); | ||
``` | ||
|
||
which is equivalent to | ||
|
||
```php | ||
$recommendation = UserRecommendation::create('user-id', 'scenario'); | ||
$recommendation->setCount(5); | ||
$recommendation->setRotationRate(1.0); | ||
$recommendation->setRotationTime(3600); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.