Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set params for Hydrator #34

Open
michalbundyra opened this issue Jan 10, 2020 · 4 comments
Open

Can't set params for Hydrator #34

michalbundyra opened this issue Jan 10, 2020 · 4 comments

Comments

@michalbundyra
Copy link
Member

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.


Originally posted by @snowwolf007cn at zfcampus/zf-apigility-admin#269

@michalbundyra
Copy link
Member Author

@michalbundyra
Copy link
Member Author

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


Originally posted by @dstockto at zfcampus/zf-apigility-admin#269 (comment)

@michalbundyra
Copy link
Member 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.


Originally posted by @snowwolf007cn at zfcampus/zf-apigility-admin#269 (comment)

@michalbundyra
Copy link
Member Author

@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.


Originally posted by @dstockto at zfcampus/zf-apigility-admin#269 (comment)

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

No branches or pull requests

1 participant