Skip to content

Changing primary key breaks getKey() #8

Closed
@leekaiwei

Description

@leekaiwei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions