Hi Salim,
if the code you're exploring is e.g. the snippet below:
class enrol_self_plugin extends enrol_plugin {
...
public function enrol_page_hook(stdClass $instance) {
...
if ($instance->id == $instanceid) {
if ($data = $form->get_data()) {
$this->enrol_self($instance, $data);
}
}
$this is the instance of the class enrol_self_plugin, when its public method enrol_page_hook will be called on that instance.
It's plain OOP (in PHP):
- http://www.php.net/manual/en/language.oop5.basic.php
- https://phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html
HTH,
Matteo