sokil / php-mongo

MongoDB ODM. Part of @PHPMongoKit
http://phpmongokit.github.io/
MIT License
242 stars 46 forks source link

Document 'afterConstruct' event not triggered properly #159

Closed rob1256 closed 6 years ago

rob1256 commented 6 years ago

The trigger of the 'afterConstruct' event is not done the same as other events and means that the resulting event does not have the document as a target. The line in question is: https://github.com/sokil/php-mongo/blob/master/src/Document.php#L124

And should just need changing to: $this->triggerEvent('afterConstruct');

sokil commented 6 years ago

fixed