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

@Accessor not works in sf2.3 #304

Closed
mrcmorales opened this issue Jun 11, 2013 · 3 comments
Closed

@Accessor not works in sf2.3 #304

mrcmorales opened this issue Jun 11, 2013 · 3 comments

Comments

@mrcmorales
Copy link

Hi,

@Accessor annotation not works with sf2.3, I have this code:

use JMS\Serializer\Annotation\Accessor;

/**
 * @ORM\Column(type="integer")
 * @Groups({"list"})
 * @Accessor(getter="getIconName")
 */
protected $icon;

public function getIconName()
{
    $reflector = new \ReflectionClass('P4f\CoreBundle\Enum\MainMenuIconEnum');
    $namesArray=array_flip($reflector->getConstants());

    return $namesArray[$this->icon];

}

Thanks

Regards

@romaricdrigon
Copy link

Hi,

I don't know if it's the same issue, but it looks alike: I'm using Symfony 2.3, Accessor by itself works fine, but if it returns an array or ArrayCollection, it will be serialized to an empty array.

So then the issue is that the returned object is not visited - event if @Type is set correctly.

Any feedback on this?

@mfoti
Copy link

mfoti commented May 28, 2014

is this bug still active?

@goetas
Copy link
Collaborator

goetas commented Jan 20, 2017

Sorry for the long feedback loop. This issue is probably already solved.
(if not feel free to re open the issue or to comment here)

Thanks

@goetas goetas closed this as completed Jan 20, 2017
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

4 participants