Jump to content

How to hook to a protected method?


pogidude
 Share

Recommended Posts

How do I hook into a protected method from my module? Example, Pages::saved(). This is defined as:

protected function ___saved(Page $page) { }

This is how my module is implemented:

class PageContentFlow extends WireData implements Module{
....
}

is it possible?

Link to comment
Share on other sites

Guessing from your question you haven't tried... :) but yes you can? Protected function also are hookable, but not directly callable as a member function outside the class. It would make no sense to have save hookable indicated by the three underscores, if it wouldn't work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...