title: How does OpenCart access its library classes?
body: <p>Im current trying to learn more about the core of OpenCart and how its classes actually work. Im also trying to advance my OOP skills in general as Im still learning in that area, so perhaps theres something obvious that Im not seeing.</p>
  
  <p>Im wondering how a controller file knows how to find the cart class (for example).</p>
  
  <p>E.g. </p>
  
  <p>In catalog/controller/checkout cart there is (obviously with code removed)</p>
  
  <pre><code>class ControllerCheckoutCart extends Controller {
      public function index() {
        $this-&gt;cart-&gt;update();
      }
  
  }
  </code></pre>
  
  <p>The Controller class can be found in system/engine/controller.php</p>
  
  <p><code>update()</code> can be found system/library/cart.</p>
  
  <p>I assumed that in the controller.php there would be a link to the cart class, or an object made from it. (Im basing that on the use of <code>$this-&gt;</code>).</p>
  
  <p>So how is the cart class actually found from the controller?</p>
  
  <p>Thank you</p>