title: Can you get a calling class's variables?
body: <p>I have a class <code>Page</code> that creates an instance of <code>DB</code>, which is named <code>$db</code>.</p>
  
  <p>In the <code>__construct()</code> of <code>Page</code>, I create the new <code>$db</code> object and I pull a bunch of config data from a file.</p>
  
  <p>Now the DB class has a method <code>_connectToDB()</code> which (attempts) to connect to the database.</p>
  
  <p>Is there a way in the DB class to call the parent class's config array? I don't want to make global variables if I don't have to and I don't want to grab the config data twice.</p>
  
  <p>Pseudo code might look something like this...</p>
  
  <pre><code>$dbUsername = get_calling_class_vars(configArray['dbUserName']);
  </code></pre>