Skip to content

Commit

Permalink
sort methods, info about default Matej values
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubTesarek committed Apr 20, 2020
1 parent 778c81e commit a7d03b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -190,7 +190,7 @@ $response = $matej->request()
$recommendations = $response->getRecommendation()->getData();
```

You can also set more granular options of the recommendation command:
You can also set more granular options of the recommendation command and overwrite Matej default behavior on per-request basis:

```php
$recommendation = UserRecommendation::create('user-id', 'test-scenario')
Expand Down
32 changes: 16 additions & 16 deletions src/Model/Command/UserRecommendation.php
Expand Up @@ -165,8 +165,8 @@ public function setModelName(string $modelName): self
/**
* Allow items, that the user has already "seen"
*
* By default user won't see any items, that it has visitted (and we have recorded DetailView interaction.)
* If you want to circumvent this, and get recommendations including the ones, that the user has already visitted,
* By default user won't see any items, that it has visited (and we have recorded DetailView interaction.)
* If you want to circumvent this, and get recommendations including the ones, that the user has already visited,
* you can set the "seen" allowance here.
*/
public function setAllowSeen(bool $seen): self
Expand Down Expand Up @@ -205,13 +205,6 @@ public function getUserId(): string
return $this->userId;
}

protected function setUserId(string $userId): void
{
Assertion::typeIdentifier($userId);

$this->userId = $userId;
}

/**
* Set number of requested recommendations. The real number of recommended items could be lower or even zero when
* there are no items relevant for the user.
Expand All @@ -227,13 +220,6 @@ public function setCount(int $count): self
return $this;
}

protected function setScenario(string $scenario): void
{
Assertion::typeIdentifier($scenario);

$this->scenario = $scenario;
}

/**
* Set how much should the item be penalized for being recommended again in the near future.
*
Expand Down Expand Up @@ -265,6 +251,20 @@ public function setRotationTime(int $rotationTime): self
return $this;
}

protected function setUserId(string $userId): void
{
Assertion::typeIdentifier($userId);

$this->userId = $userId;
}

protected function setScenario(string $scenario): void
{
Assertion::typeIdentifier($scenario);

$this->scenario = $scenario;
}

protected function assembleFiltersString(): string
{
return implode(' ' . $this->filterOperator . ' ', $this->filters);
Expand Down

0 comments on commit a7d03b3

Please sign in to comment.