title: Help me to recognize the technique i use in this php example and naming it
body: <p>Ok so at work we have discovered that this method to fetch related data / objects is something near awesome.</p>
  
  <p>Right to example, i have this class with some related objects inside:</p>
  
  <pre><code>class Country {
  
  private $language; //$language will be an object of class Language
  private $regions; //$regions will be an ARRAY of Region objects
  
  //in the constructor i don't load regions or language
  
  //magic method
      public function __get($name) {
  
          $fn_name = 'get_' . $name;
  
          if (method_exists($this, $fn_name)) {
              return $this-&gt;$fn_name();
          } else {
              if (property_exists($this, $name))
                  return $this-&gt;$name;
          }
  
          return $this-&gt;$name;
      }
  
      public function get_language () {
  
          if (is_object($this-&gt;language)) return $this-&gt;language;
  
          $this-&gt;language = new Language($params); //example
  
          return $this-&gt;language;
      }
  
      public function get_regions () {
  
          if (is_array($this-&gt;regions)) return $this-&gt;regions;
  
          $this-&gt;regions = array();
  
          $this-&gt;regions[] = new Region('fake');
          $this-&gt;regions[] = new Region('fake2');
  
          return $this-&gt;regions;
      }
  }
  </code></pre>
  
  <p>so the idea is:</p>
  
  <p>i want an instance of Country, but i dont need its language and regions now.</p>
  
  <p>In another case i need them, so i claim them as properties, and the magic method retrieves them for me only the first time.</p>
  
  <pre><code>$country = new Country();
  
  echo "language is". $country-&gt;language-&gt;name;
  
  echo "this country has ". sizeof($country-&gt;regions)." regions";
  </code></pre>
  
  <p>This <strong>on-demand</strong> method (that avoids nested loop of related objects too) has a name?
  Maybe <em>lazy loading properties</em>? <em>On-demand properties</em>?</p>