pogidude Posted July 30, 2013 Share Posted July 30, 2013 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 More sharing options...
Soma Posted July 30, 2013 Share Posted July 30, 2013 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 More sharing options...
pogidude Posted July 30, 2013 Author Share Posted July 30, 2013 thanks Soma. yeah, actually I already did try, I wanted to hook to Pages::saved() and had typed Page::saved() instead, which led to a lot of head banging.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now