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

Already on GitHub? Sign in to your account

ProxyFactory::isShortIdentifierGetter doesn't work with identifier types different from 'id' and 'custom_id' #490

vkartaviy opened this Issue Feb 5, 2013 · 5 comments


None yet
3 participants

vkartaviy commented Feb 5, 2013

For example, I have identity with type="Int" and strategy="AUTO":

 * @Mongo\Id(type="int", strategy="AUTO")
 protected $id;

And in proxy class it generated as:

public function getId()
    return parent::getId();

jmikola commented Feb 12, 2013

This may be a documentation shortcoming, but I don't believe you should be using anything other than id and custom_id for the identifier mapping. The logic in ClassMetadataInfo seems to allow it (custom_id gets set if the strategy is not AUTO), but it appears to be an uncaught edge case. @jwage: thoughts?


vkartaviy commented Feb 15, 2013

@jmikola The problem is that I am using already existent data from geonames.org with internal references and they are have Integer identifiers...


jmikola commented Feb 19, 2013

I'm suggesting you change type="int" to type="custom_id". You may also want to use the NONE strategy if you're going to be assigning your own identifier values.


vkartaviy commented Feb 19, 2013

Thank you. I will try and give you to know...


malarzm commented Nov 5, 2015

As of now using strategy="NONE" and type="int" should be the way to go :)

@malarzm malarzm closed this Nov 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment