- Require PHP ^7.3
- Added optional argument
timestamp
toUserMerge
command.
- Add support for new recommendation types -
UserUserRecommendation
,ItemUserRecommendation
,ItemItemRecommendation
.
- BC BREAK | Remove deprecated constant
FILTER_TYPE_MQL
fromUserRecommendation
. - BC BREAK | Rename class
UserRecommendation
toUserItemRecommendation
. - BC BREAK | Rename class
MinimalRelavance
toItemMinimalRelevance
. - BC BREAK | Rename class
Sorting
toItemSorting
.
- Attribute
item-id
renamed toitem_id
in recommendation request response.
- Added support for Matej command
resetData()
to remove data from instance.
- Mark
UserRecommendation::FILTER_TYPE_MQL
deprecated.
- Response to UserRecommendation request without specified item properties now works as documented.
Each recommendation is an instance of
StdClass
containingitem_id
property.
- Client doesn't send no longer used parameter
filter_type
.
- Add support for recommendation boosting rules (via
addBoost()
). - Custom attributes which can be send as part of
Interaction
usingsetAttribute()
/setAttributes()
methods. See UPGRADE-3.0.md.
- BC BREAK |
UserRecommendation::create()
now accepts only$user_id
and$scenario
parameters, all other arguments are optional and are set using setter methods. See UPGRADE-3.0.md for details. - BC BREAK | Interaction types are now defined via string parameter (and not named constructors) and can be created using new
withItem()
orwithAliasedItem()
methods. See UPGRADE-3.0.md.
- No changes in the library, new version released because of adjustments of PHP 5.6 compatible fork.
- Internal codestyle improvements.
- Allow httplug 2.0 dependency.
- Mark some internal classes
@internal
.
- Method
isSuccessfull()
toResponse
providing simple check whether the whole response (all of contained command responses) are successful (ie. none of them is invalid). This is also recommended way how to validate response successfulness.
- Invalid command inside recommendation/sorting request does not cause whole request to fail, rather the specific command response is marked as invalid.
- Deprecated
CommandResponse::STATUS_ERROR
, because Matej no longer uses it (CommandResponse::STATUS_INVALID
is instead used everywhere). - Method
CommandResponse::isSuccessfull()
now returns true even for not only OK but also SKIPPED (ie. not invalid) statuses. This also meansResponse::getNumberOfSuccessfulCommands()
now won't necessarily return the same number of command responses that return true onCommandResponse::isSuccessful()
.
- New item property type
geolocation
.
- Client version information sent in request header.
UserRecommendation
has new methodsetAllowSeen(true|false)
, which allows recommending of already visited items.
See UPGRADE-2.0.md for upgrade instructions.
- BC BREAK |
UserRecommendation
now returns new format of response in->getData()
, which is a list ofstdClass
instances. - BC BREAK |
UserRecommendation
does not have default filter (was previously set to:valid_to >= NOW
). - BC BREAK |
UserRecommendation
now uses MQL query language by default for filtering. - BC BREAK | Minimal relevance passed to
setMinimalRelevance()
method ofUserRecommendation
command must be of enum typeMinimalRelevance
. - BC BREAK |
getForgetMethod()
method ofUserForget
command now returns instance ofUserForgetMethod
enum instead of string.
- Exceptions occurring during async request now generate rejected promise (as they should) and are no longer thrown directly.
- Ability to request item properties in
UserRecommendation
command, which are then returned by Matej alongside withitem_id
.
UserForget
command to anonymize or completely delete all data belonging to specific user(s) ($matej->request()->forget()
).
- Declare missing direct dependencies (to
php-http/message
,php-http/promise
andpsr/http-message
) in composer.json.
- A/B testing support for recommendation and sorting requests.
- Allow users of commands passed to
$matej->request()->recommendation()
to be: (B [interaction], A -> B [user merge], B [recommendation]) in accordance with new Matej API behavior. - Type hints and type assertions relevant only for PHP 5 version removed from codebase and are now added only to PHP 5 version of the library (in
RequestBuilderFactory
,Command\Interaction
,Command\UserRecommendation
).
- Endpoint to reset Matej test-databases (
$matej->request()->resetDatabase()
).
- Check for equality of user ids in
UserMerge
- so that we don't "merge" user into the same user id
- Allow setting rotation time = 0 in UserRecommendation, because it is now also accepted by Matej API.
- Unify
self
/static
/$this
return typehints.
- Checking of consistent user ids on
recommendation()
andsorting()
requests was not working in accordance with API behavior.
- Endpoint to get all defined item properties in the Matej database (
$matej->request()->getItemProperties()
). Response
now containsgetCommandResponse(int $index)
to provide direct access to individual command responses.- Syntaxt sugar shortcuts to provide semantic access to data of the responses:
sorting()->send()
now returnsSortingResponse
instance (so you can call eg.$response->getSorting()
).recommendation()->send()
now returnsRecommendationResponse
instance (so you can call eg.$response->getRecommendation()
).getItemProperties()->send()
now returnsItemPropertiesListResponse
instance (so you can call eg.getItemProperties()->send()->getData()
).
- Validate max. 1000 commands are added to
campaign()
,events()
,setupItemProperties()
anddeleteItemProperties()
requests (in accordance with Matej batch API limit).
- Commands which include user now implements
UserAwareInterface
andgetUserId()
method (ie. Interaction, Sorting, UserMerge, UserRecommendation). - Custom request ID could be passed to a request (via
setRequestId()
method of request builders). If none is set, random request ID is generated. - Response ID could be read from the response via
getRequestId()
method of the Response object.
- Validate all commands of
recommendation()
andsorting()
request involve the same user. - Validate Item properties to not contain
$property['item_id']
as that would redefine the primary key in Matej database. - Validate Item property setup to not set up property named
item_id
as that would conflict with the primary key in Matej database.
- URL assembling was not working on systems with non-standard setting of
arg_separator.output
PHP directive.
- All exceptions now implement
MatejExceptionInterface
instead of subclassingAbstractMatejException
. - Exceptions raised during response processing are now all of
ResponseDecodingException
type. - Values passed to Command objects are now validated on construction and throws
Lmc\Matej\Exception\DomainException
when invalid.
UserMerge
command andaddUserMerge
&addUserMerges
method forEventsRequestBuilder
. (Accessible via$matej->request()->events()->...
).Interaction
command andaddInteraction
&addInteractions
method forEventsRequestBuilder
. (Accessible via$matej->request()->events()->...
).CampaignRequestBuilder
to request batch of recommendations and item sortings for multiple users. (Accessible via$matej->request()->campaign()->...
).SortingRequestBuilder
to request item sortings. (Accessible via$matej->request()->sorting()->...
).RecommendationRequestBuilder
to request recommendations for single user. (Accessible via$matej->request()->recommendation()->...
).- Method
isSuccessfull()
ofCommandResponse
for easy and encapsulated detection of successful command responses.
- Return types of methods in
RequestBuilderFactory
were not defined (and were not guessable by an IDE) for PHP 5 version.
- Initial version. Allows to build (and execute) requests of
ItemProperty
andItemPropertySetup
commands toitem-properties
andevents
endpoints.