Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Model.initialize event and rework how Component::initialize() works #4823

Merged
merged 4 commits into from
Oct 10, 2014

Commits on Oct 6, 2014

  1. Add Model.initialize event.

    This event follows the same pattern as Controller.initialize where it is
    fired *after* the initialize() method and after other subscribers have
    been attached. The initialize() method is *not* an event subscriber as
    it is intended to be a post-constructor hook method like
    Controller::initialize().
    
    This will likely result in Component::initialize() being modified to be
    conformant. There have been a number of reported issues in the past
    around Component::initialize() not being called. It would be nice to put
    those issues to rest and have consistency across the framework.
    markstory committed Oct 6, 2014
    Configuration menu
    Copy the full SHA
    c71f919 View commit details
    Browse the repository at this point in the history
  2. Make Component::initialize() work like other initialize() methods.

    Make Component::initialize() consistent with Controller and Table, this
    makes the framework easier to understand as methods with the same name
    work consistently everywhere. While I'm not totally sure about what to
    do with the Controller.initialize event hook in components, I feel this
    change is a good one even though it breaks existing API compatibility.
    
    The primary use of this event hook was RequestHandler which has been
    updated to not rely on the event hook. I've also ensure that
    Controllers always have a request and response object as that was
    causing me some grief and logically makes sense.
    markstory committed Oct 6, 2014
    Configuration menu
    Copy the full SHA
    293b4b0 View commit details
    Browse the repository at this point in the history
  3. Add Component::beforeFilter

    This method is an event listener that listens to the
    Controller.initialize event. I decided to copy the controller method
    name so there was some semblance of consistency. This may be a bad idea
    though.
    markstory committed Oct 6, 2014
    Configuration menu
    Copy the full SHA
    946bf55 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6595628 View commit details
    Browse the repository at this point in the history