If I set 'entity_identifier_name' => 'code' then the links to the entities are not generated when fetching the collection. The link is generated when fetching an entity only.
I have tried poking around in the code, and in
ZF\Hal\Plugin\Hal::setEventManager() it seems to be hardcoded looking for 'id' (lines 168/169). If I hack this to 'code' then it populates just fine.
In the meantime, I have hooked into the 'getIdFromEntity' listener and made an ugly hack to try to extract this key.
If I set 'entity_identifier_name' => 'code' then the links to the entities are not generated when fetching the collection. The link is generated when fetching an entity only.
Following the code at https://groups.google.com/a/zend.com/forum/#!msg/apigility-users/p4BWDl9oiIM/YnitOfkEAfUJ will now provide an entry for all properties in the entity. Obviously not a good response since these properties are not set when fetching a collection.
I have tried poking around in the code, and in ZF\Hal\Plugin\Hal::setEventManager() it seems to be hardcoded looking for 'id' (lines 168/169). If I hack this to 'code' then it populates just fine.
In the meantime, I have hooked into the 'getIdFromEntity' listener and made an ugly hack to try to extract this key.
Originally posted by @vorgas at https://github.com/zfcampus/zf-hal/issues/166