Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Can't set params for Hydrator #269

Open
snowwolf007cn opened this issue Mar 20, 2015 · 5 comments
Open

Can't set params for Hydrator #269

snowwolf007cn opened this issue Mar 20, 2015 · 5 comments

Comments

@snowwolf007cn
Copy link

To solve the problem How to set repsonse object key in camelcase but not in underscore?,the best way is to use the ClassMethod Hydrator to false. But the constructor params can't be set in admin UI.

@poisa
Copy link

poisa commented Mar 20, 2015

@dstockto
Copy link

You could subclass it as you did, or you could provide a factory for the ClassMethods hydrator and assign a different name:

https://groups.google.com/a/zend.com/d/msg/apigility-users/HLZ1KZKi17A/f3GFcwlLNFEJ

@snowwolf007cn
Copy link
Author

@dstockto Thanks, that's what I really want.
But I found another bug in UI, if I config hydrators like this:

'hydrators' => array(
        'invokables' => array(
            'Application\\Stdlib\\Hydrator\\CamelCasedClassMethods' => 'Application\\Stdlib\\Hydrator\\CamelCasedClassMethods',
        ),
    ),

There is only one entries added in Admin UI, which is correct;

if I configure hydrators below:

'hydrators' => array(
        'invokables' => array(
            'Application\\Stdlib\\Hydrator\\CamelCasedClassMethods' ,
        ),
    ),

or

'hydrators' => array(
        'invokables' => array(
            'Some\\Other\\Name'=>'Application\\Stdlib\\Hydrator\\CamelCasedClassMethods' ,
        ),
    ),

it'll add 2 entries in selectors.

Is it a bug or I do things wrong?

I'm working with dev-develop, thanks.

@dstockto
Copy link

@snowwolf007cn I think that the hydrator manager will let you get a hydrator by either the key or the full class name. It sounds like Apigility is exposing both of these as well.

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-admin; a new issue has been opened at laminas-api-tools/api-tools-admin#34.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants