You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.
In my IDE, in my user class I get this following warning:
Class must be declared abstract or implement method 'getCollectionName'
Which refers to the
abstract protected function getCollectionName();
in EMongoRecord. This means that your model has to have a 'getCollectionName' method because the superclass (EMongoRecord) has it declared as abstract. Renaming 'getCollectionName' to collectionName fixes this error, as well as renaming collectionName to getCollectionName in my user model. This way they are both the same name and the user model subclass properly has its own copy of that method.
I could possibly be wrong on this, but the change and what the IDE makes sense to me and an abstract method is supposed to be used in a subclass that extends it.
The text was updated successfully, but these errors were encountered:
I do not understand You on this, You have to write (cover) getCollectionName() method for every of yours records, because in superclass i cannot know witch collection to use; see the first example in readme file
That is what I mean. In the Readme, it says that In my User.php model I need collectionName() but my User.php model needs getCollectionName() because that is what the superclass has. This is because getCollectionName() it is abstract in EMongoRecord.
So, when i use getCollectionName() in my User.php model, i have no errors. This means that the readme should say to enter getCollectionName(), and not collectionName(). I would want to use getCollectionName() to use the getter method properly and not call collectionName() directly. I hope I explained this properly.
oh my bad thx for clarification, it should stay as getCollectionName() because then you can just use $model->collectionName; as a read-only property, i'll fix readme, thx :)
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In my IDE, in my user class I get this following warning:
Class must be declared abstract or implement method 'getCollectionName'
Which refers to the
abstract protected function getCollectionName();
in EMongoRecord. This means that your model has to have a 'getCollectionName' method because the superclass (EMongoRecord) has it declared as abstract. Renaming 'getCollectionName' to collectionName fixes this error, as well as renaming collectionName to getCollectionName in my user model. This way they are both the same name and the user model subclass properly has its own copy of that method.
I could possibly be wrong on this, but the change and what the IDE makes sense to me and an abstract method is supposed to be used in a subclass that extends it.
The text was updated successfully, but these errors were encountered: