Go see the migration guide to see how to migrate from v0 to v2
- [BREAKING] Drop annotations support, replace by PHP8 attributes #124 by @JulienRAVIA
- [BREAKING] Remove support of PHP < 8.1 and Symfony < 4.0 #121 by @jdeniau
- Migrate unit tests from atoum to phpunit #123 by @jdeniau
(wrongly pushed version, removed from packagist)
- Collection.php compatibility with PHP 8.1
- [Breaking] Added compatibility for PHP 8.1
Replace abandonned misd/phone-number-bundle
Allow Symfony 5 and Guzzle 7
- Fix incompatibility with DateTimeImmutable and Symfony >= 4.4
Fix issue when content-type
header is in lowercase
Removed default registryFile
Added phpstan extension
Added a Mapado\RestClientSdk\SdkClientRegistry
to facilitate SdkClient selection when we don't really care about which Client manages our entity.
This is totally inspired by Doctrine Persistence ManagerRegistry.
- Fixed issue with Symfony < 3.1
- Allow
datetime
type to be either aDateTime
or aDateTimeImmutable
instance.
- Removed a
var_dump
introduced in0.32.0
- Leverage Symfony Property Access component instead of homemade
$setter
and$getter
methods (#92) - Throw an exception if the
setter
method does not exists on entity (#91) RestException
now has agetRequest(): ?\Psr\Http\Message\RequestInterface
function
Fixes #90 (allow int as id in model).
- [MINOR BC]
Mapado\RestClientSdk\RestClient::getCurrentRequest(): Request
changed toMapado\RestClientSdk\RestClient::getCurrentRequest(): ?Request
. The call can now return null if we are in acli
execution mode. It will not break if you do not extend theRestClient
class (the function is protected).
- [BREAKING] Drop support for PHP < 7.2
- [BREAKING] Use type hinting for return types and parameter everywhere
- [MIGHT BREAK] use
declare(strict_types)
everywhere - [MIGHT BREAK] the identifier attribute (
@Rest\Id
) is mandatory to callClassMetadata::getIdentifierAttribute()
It previously defaulted toid
. It was more to avoid BC break in Mapado codebase more than a real feature. It now throws an instance of MissingIdentifierException This way is is less magic and more understandable. - [MIGHT BREAK] Throw a lot more exception than before in different case that should not really happen (like calling
getMetadata
with a wrong model name for example). - Throw an exception if two identifier attributes are set for an entity
- Fix issue with
UnitOfWork::registerClean
when we callEntityRepository::find()
Fix issue with return type introduced in 0.29.2
- log response in case of
RequestException
$unitOfWork
in SdkClient constructor is optionnal
- [Might break] The deserialization process (response → object) now accept object without an identifier. These object might be partial object OR entity without an identifier attribute at all
- Use php-cs-fixer and prettier-php to format code
- Fix issue when calling proxy id from twig which return an empty id instead of the real id
- fix issue with call on isset with id
- Upgrade to ProxyManager
^2.0
- [Might Break] Remove dependencies on
misd/phone-number-bundle
. If you used this, you need to either:- Set the dependency in your
composer.json
file, - Or set the dependency on
giggsey/libphonenumber-for-php
only (as the bundle is not used in this package)
- Set the dependency in your
- [Breaking] Drop support for PHP < 7.1
- Use PHPStan to detect errors
- Fix issue with count and PHP 7.2
- Drop support for PHP < 7.0
allow calling magic method isset
on id
- persisting an entity now leverage the power of the
UnitOfWork
and onlyPOST
data that are not null. See #68
- Avoid notice for new entity in
UnitOfWork
#4eee2ba
- ignore backtrace args to save memory
- Add the backtrace in the log
- fix notice in
UnitOfWork
- The UnitOfWork now treat array (without Relation) as full object and does not make a
diff
on them
- add Mapado\RestClientSdk\UnitOfWork in constructor of Mapado\RestClientSdk\EntityRepository
- Add current request uri as referer #56
- This package requires
symfony/http-foundation: ^2.7||^3.0
- Added support for abstract entities #56
-
Mapado\RestClientSdk\Collection\HydraCollection
does not exists anymore and is replaced byMapado\RestClientSdk\Collection\Collection
- It is now a simple collection that could contain anything
-
Some internal breaking changes that might affect you:
Mapado\RestClientSdk\Collection\Collection
constructor forbid using anything else than an array as a first argumentModel\ModelHydrator::deserializeAll
is now private
Collection
objects now accept anextraProperties
parameter as second argument- HAL JSON response should now be supported
- Mapping now accept a configuration array. This array can take a 'collectionKey' key to set the list default JSON key (default
hydra:member
). The key can contain dots for sublevel.
- When calling a GET query (mainly with
find
/findBy
orfindAll
), every 4xx response status code except 404 will now throw aMapado\RestClientSdk\Exception\RestClientException
(404 will still returnnull
value). See #35 and c9066a8
- Change method visibility from private to protected:
fetchFromCache
saveToCache
removeFromCache
addQueryParameter
@id
key is not automatically serialized when the attribute name isid
, you must set@Attribute(name="@id")
in your relation (ornew Attribute('@id', 'id')
)- @Rest\Id is mandatory
Mapado\RestClientSdk\Mapping\Attribute
constructor now takes the parameter name as second parameter
- Fix bug when attribute name and
@Attribute(name="foo")
is not the same (#13)
- Replace the
AbstractClient
by theEntityRepository
- remove the
client
parameter to the Annotation, replaced byrepository
if needed - The
getClient
method from theSdkClient
is removed and replaced by thegetRepository
method- The
getRepository
method accepts the classname of the Model or the key specified in the mapping
- The