Question: I am currently working through the `Opencart` code, line by line, starting with `index.php`. I am understanding most of it but am wanting to understand all of what I look at. But so far I cannot figure this out: Please read on.

I realise that `$this->` refers to the current object, and that $this->load would normally refer to a method called 'load' in the current object.

If I see `$this->config->load`, then I am fine, because the Config class declares a 'load' method. 

But I see `$this->load->model('catalog/category');` in the `ControllerProductProduct` class yet can find no 'load' method in that class, nor do I find it in the parent Controller class.

I know also that 'load' is not a standard PHP function so I am left not understanding which object method `$this->load` actually refers to.

Any help appreciated.

Answer: 
OpenCart uses the magic method's `__get` and `__set` to do this dynamically using the registry of objects. You can find the coding of this in `/system/engine/controller.php`
Perhaps this will clear it up for you, look at catalog/index.php line 33 (OPencart 1.5.4.1)

```
// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

```