Open iforp opened 10 years ago
@Agent-J please feel free to try this out and run the unit tests to make sure everything works fine and submit a PR.
That said I know that there are issues with using static in PHP v5.3.
With regard to calling $class::... When the method is run it is called from the inherited abstract class but the attributes belong to the child class. This allows access to the child's scope where other options will keep the scope relative to the abstract class. If this has been fixed in later versions we can add that as a conditional.
There are a lot of calling like
self::connection()
in\Purekid\Mongodm\Model
. Why don't you usestatic::connection()
?Because of this issue I can't override some methods in my subclass.
For example:
in this simple example method
BaseModel::connection()
will never be executed.Moreover you use a lot of constructions like
instead you should use