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

Accessor annotation ignored #40

Closed
alex88 opened this issue Feb 19, 2013 · 3 comments
Closed

Accessor annotation ignored #40

alex88 opened this issue Feb 19, 2013 · 3 comments

Comments

@alex88
Copy link

alex88 commented Feb 19, 2013

Hi, in the entity I've this code:

/**
 * @var \DateTime $gamedatetime
 *
 * @ORM\Column(name="gameDateTime", type="datetime", nullable=false)
 * @SerializationGroups({"api.mobile.match.list.generic"})
 * @Accessor(getter="getGameDateTimestamp")
 * @Assert\NotBlank()
 */
private $gameDateTime;


public function getGameDateTimestamp()
{
    return $this->gameDateTime->getTimestamp();
}

I'm running f95ba2 commit and it seems the accessor doesn't make any difference, setting a wrong function gives no errors, tried to add a die() inside and never get called..

@alex88
Copy link
Author

alex88 commented Feb 19, 2013

I've also tried to add the @accesstype("public_method") annotation, now it's calling getDateTIme() function, still not the one set by the Accessor annotation

@alex88
Copy link
Author

alex88 commented Feb 19, 2013

Nm, retyping the annotation by hand make it working 😩

@alex88 alex88 closed this as completed Feb 19, 2013
@alex88
Copy link
Author

alex88 commented Feb 19, 2013

@Narretz yeah thanks for the tips, the @groups annotation has been renamed since I've an entity called Group and I don't want to mix the names by error.
The issue was about some encoding or something really weird since the source code I've copied from works fine.
Retyped by hand and it worked fine!

# 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

1 participant