Skip to content

Version 0.3: redesigned from bottom to top

Compare
Choose a tag to compare
@tristanjahier tristanjahier released this 19 Apr 19:31
· 339 commits to master since this release

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 powerful where() method to filter its content.
  • An Arrayable interface to ensure the presence of toArray() method.
  • Methods to ease handling boolean-type preferences: enable(), disable() and isEnabled().
  • "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 and entityKeys() 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 to Users module.
  • Entities serialization.

Changed

  • Dropped support for PHP 5.5. Minimum requirement is now PHP 7.1.
  • Renamed namespace Zoho\CRM into Zoho\Crm.
  • Renamed Exception namespaces into Exceptions.
  • Replaced Request class with Query class, which is more flexible and provides method-chaining possibilities. Also replaced RequestPaginator with QueryPaginator.
  • More generally, completely redesigned the request pipeline.
  • Removed class RequestLauncher, moved the request counter to Client.
  • Removed ModuleFields instance (e.g. $zoho->contacts->fields) from modules that do not support the getFields API method.
  • Removed functions.php and replaced them with a static class helper: Zoho\Crm\Support\Helper.
  • Made entities Collection, IdList, UrlParameters and Preferences extend the new generic collection Zoho\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. Use toAliasArray() 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 (formerly RequestPaginator).
  • 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.