Version 0.3: redesigned from bottom to top
THIS IS A BREAKING CHANGE RELEASE
Added
- Installation instructions in README.md.
- A generic collection class:
Zoho\Crm\Support\Collection
. It supports a lot of common array-like operations and has a powerfulwhere()
method to filter its content. - An
Arrayable
interface to ensure the presence oftoArray()
method. - Methods to ease handling boolean-type preferences:
enable()
,disable()
andisEnabled()
. - "exception_messages_obfuscation" preference to hide the API auth token in request exception messages.
newEntity()
method to modules.- A reference to the client and module in entities.
key()
method to entities andentityKeys()
to entity collections.- Ability to use a custom API endpoint.
- Ability to define module aliases. Useful for custom modules whose names are awful (CustomModule1...)
- Support for API error 4421 through
RequestLimitExceededException
. primaryKey()
method toUsers
module.- Entities serialization.
Changed
- Dropped support for PHP 5.5. Minimum requirement is now PHP 7.1.
- Renamed namespace
Zoho\CRM
intoZoho\Crm
. - Renamed
Exception
namespaces intoExceptions
. - Replaced
Request
class withQuery
class, which is more flexible and provides method-chaining possibilities. Also replacedRequestPaginator
withQueryPaginator
. - More generally, completely redesigned the request pipeline.
- Removed class
RequestLauncher
, moved the request counter toClient
. - Removed
ModuleFields
instance (e.g.$zoho->contacts->fields
) from modules that do not support thegetFields
API method. - Removed
functions.php
and replaced them with a static class helper:Zoho\Crm\Support\Helper
. - Made entities
Collection
,IdList
,UrlParameters
andPreferences
extend the new generic collectionZoho\Crm\Support\Collection
. - Removed all formerly existing client preferences. All queries are now strictly validated, paginated queries are now automatically fetched when needed, and the records are now always returned as entity objects when possible.
- Most of the modules methods now return a
Query
object (instead of executing a request), so that the developer can chain his own constraints before actually making a call to the API. - Most of the modules methods have been renamed.
- Allowed to create a query by calling the name of an API method directly on a module instance. e.g.
$zoho->potentials->getRecords()
. - Entities
toArray()
method now return the real Zoho property names instead of aliases. UsetoAliasArray()
to get the former result. - Improved how modules are attached to the client and handled internally.
Fixed
- A bug when trying to determine if we reached the maximum modification date while fetching pages in
QueryPaginator
(formerlyRequestPaginator
). - URL parameters are now properly encoded.
- Parsing for a rare (but odd!) API response for module Events when there is no data.
Development
- Autoload
dev_material/src
directory in development environment. - Added custom casters for symfony/var-dumper and PsySH local config file (
.psysh.php
) to load them automatically.