zfcampus/zf-apigility-admin — pull request #178 by weierophinney (2014-05-22 22:39:08+00:00)
Title: [#177] Ensure DB-Connected configuration is properly updated

The Admin UI sends the entire DB-Connected resource across in every request.
This raises an issue, because the `resource_class` is always sent as a `null`
value (as we do not want to reference "virtual" resource classes for purposes
of the source code view modal). Because this is `null`, we end up updating a
null value.

We can get the `resource_class` when fetching the original service data by
passing a boolean `false` to the `$isAFetchOperation` flag; this forces the
DB-Connected `onFetch()` listener to include it when returning the entity.
However... we were not passing that flag when doing `updateService()`
operations, which meant that updating a DB-Connected service always wrote the
DB-Connected configuration under a blank key.

This patch does two things:

- It now passes the `$isAFetchOperation` flag for update operations.
- It now pulls the `resource_class` from the updated REST entity prior to
performing db-connected-specific update oparations.