octobercms/library — pull request #26 by Flynsarmy (2014-07-04 06:52:27+00:00)
Title: Add global events for model attribute getters

Models currently support emitter events but not global events for attribute getters. I want to add a getter for `$user->rewardspoints_points` that can be used anywhere but this currently isn' tpossible. The below commit adds Event hooks in the `getAttribute` methods.

Two notes:
* I'd also love for the getter events to pass $this - as the value of the getter may be dependant on other aspects of the model. As a very quick example, if the user's state is QLD, we know his country is Australia.
* There are many other emitter events in this class that don't have global event equivalents. These should also be fixed up.