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

Closed
vkartaviy opened this Issue Feb 5, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

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()
{
    $this->__load();
    return parent::getId();
}
Owner

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?

Contributor

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

Owner

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.

Contributor

vkartaviy commented Feb 19, 2013

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

Member

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