title: Understanding PHP Inheritance
body: <p>I understand the basic principles of inheritance in OOP, but I have a specific thing I am trying to do and want advice on how best to do it.</p>
  
  <p>Lets say I have a core class:</p>
  
  <pre><code>class Core {
      ....
  }
  </code></pre>
  
  <p>and I also have 2 or more other classes that extend this functionality</p>
  
  <pre><code>class MyClass1 extends Core {
      ....
  }
  class MyClass2 extends Core {
      ....
  }
  </code></pre>
  
  <p>and I also have a database class in which I perform my queries, I want to pass an instantiated object of the database class (possibly by reference) to each one of my classes. One of the reasons for this would be to store a list or count of the queries that page as executed.</p>
  
  <p>How should / can I go about this?</p>