-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
We should refactor the function names in the classes to better reflect the server api functions for more uniformity.
Here's what has to be done.
in issue #13 @jsteemann wrote:
The APIs changed several times in the beginning. The PHP client API for example does not have a db class/object at all, so there is not use case for the underscore methods in it.
My suggestion for collection method names in the PHP API (class CollectionHandler) therefore is:
- delete(): rename to drop() and make delete() call drop(). delete() should be marked as deprecated
- add(): rename to create() and make add() call create(). add() should be marked as deprecated.
- getFigures(): rename to figures() and make getFigures() call figures(). getFigures() should be marked as deprecated.
- getCount(): rename to count() and make getCount() call count(). getCount() should be marked as deprecated.
- get(): not sure about this. In the server API this method does not have a name, it's simply db.COLLECTIONNAME there. Probably leave it like it is?
Then there's the DocumentHandler:
- getByExample(): rename to byExample() and move into CollectionHandler. make DocumentHandler::getByExample() call CollectionHandler::byExample(). getByExample() should be marked as deprecated
- getAllIds(): move to CollectionHandler and make DocumentHandler::getAllIds() call CollectionHandler::getAllids(). DocumentHandler::getAllIds() should be marked as deprecated
- get(): no idea for this. Probably leave it like it is?
- getById(): same
- add(): rename to save() and make add() call save(). add() should be marked as deprecated
- update(): rename to replace() and make update() call replace(). update() should be marked as deprecated. Announce new meaning for update() in ArangoDB 1.1 (will support HTTP patch method to partially update documents)
- updateById(): rename to replaceById() and make updateById() call replaceById(). updateById() should be marked as deprecated. Announce new meaning for updateById() in ArangoDB 1.1 (will support HTTP patch method to partially update documents)
- delete(): rename to remove() and make delete() call remove(). delete() should be marked as deprecated