Skip to content
New issue

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

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

Already on GitHub? # to your account

Use different accessor for each group #420

Closed
mangelsnc opened this issue Mar 25, 2015 · 3 comments
Closed

Use different accessor for each group #420

mangelsnc opened this issue Mar 25, 2015 · 3 comments

Comments

@mangelsnc
Copy link

Taken for example this piece of code:

/**
 * @ORM\Column(type="string", length=255, nullable=true)
 * @Serializer\Accessor(getter="getAbsolutePath")
 * @Serializer\Groups({"minimal", "details", "search-result"})
 */
 protected $path;

I pretend to use an accessor for minimal and details groups (for example getRelativePath) and a different one for search-result (getAbsolutePath).
As far as I know, there's no way to do this, but I think it could be a very interesting feature.

Exists a simple way to do this? In case of no, what do you think about add this feature?

@sebastianhoitz
Copy link

👍 we need exactly this feature in one of your projects, too.

@Eliaenor
Copy link

Eliaenor commented Sep 22, 2016

Any news about this feature ?

@goetas
Copy link
Collaborator

goetas commented Sep 22, 2016

actually this can be done using virtual properties on specific accessor methods

@goetas goetas closed this as completed Sep 22, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants