Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for allow_seen in Recommendation requests #87

Merged
merged 1 commit into from
Sep 18, 2018

Conversation

foglcz
Copy link
Contributor

@foglcz foglcz commented Sep 13, 2018

Type Feature
Fixes issues RAD-1735
Requires Matej >= 7.46.0
Documentation updated
BC Break No
Tests updated yes
Notes n/a

By default, "seen" is any item, that the user has DetailView'ed. This however, can be changed for any given model, so "seen" can mean different things in default and gamma model for any particular client.

VincTheSecond
VincTheSecond previously approved these changes Sep 14, 2018
CHANGELOG.md Outdated Show resolved Hide resolved
/**
* Allow items, that the user has already "seen"
*
* By default user won't see any items, that he or she has visitted (and we have recorded DetailView interaction.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has visited

* If you want to circumvent this, and get recommendations including the ones, that the user has already visitted,
* you can set the "seen" allowance here.
*/
public function setAllowSeen(bool $seen = true): self
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing - we should either has setter setAllowSeen(bool) with required parameter, or two methods to set it to true and false (allowSeen() and eg. disallowSeen()). For simplicity I'd go for the first variant, but for sure not mix those two approaches.

@@ -242,6 +258,10 @@ protected function getCommandParameters(): array
$parameters['model_name'] = $this->modelName;
}

if ($this->allowSeen) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather strict comparison (eg. !== false) instead of this truthy condition.

@OndraM OndraM merged commit 30161bd into master Sep 18, 2018
@OndraM OndraM deleted the feature/allow-seen branch March 31, 2020 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants