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

Changing primary key breaks getKey() #8

Closed
leekaiwei opened this issue Jul 26, 2013 · 2 comments
Closed

Changing primary key breaks getKey() #8

leekaiwei opened this issue Jul 26, 2013 · 2 comments

Comments

@leekaiwei
Copy link
Contributor

If I extend MongoDB Eloquent and set my own $primaryKey = 'myId', calling $this->getKey() returns null. However, I can access the key using $this->_id and not $this->myId. I think that the original primary key for some reason is not being re-declared in the extended class.

jenssegers added a commit that referenced this issue Jul 26, 2013
@jenssegers
Copy link
Contributor

Can you check if it is working with this last fix?

@leekaiwei
Copy link
Contributor Author

Yes it is working. Thanks very much!

alcaeus pushed a commit to alcaeus/laravel-mongodb that referenced this issue Aug 16, 2023
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this issue Sep 2, 2024
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

2 participants