self = $hooks->wrap( $this ); $this->post = $hooks->wrap( $post ); $this->notificator = $notificator; } public function beforeExecute() { $isOff = $this->post->get('notifications_turnoff'); if( $isOff ){ $this->notificator->setOff(); } else { $this->notificator->setOn(); } } public function afterExecute( $ids ) { } }