title: User class - 'load' data
body: <pre><code>&lt;?php
  
  class User {
  
      private $id;
      private $username;
  
      public function __construct($id = null) {
          $this-&gt;id = $id;
  
          if (!is_null($this-&gt;id)) {
              $this-&gt;load();
          }
      }
  
      public function load() {
  
  
      }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>In the 'load' method I am going to load all the information from the current user (id) But I wonder how is the best way to load all info. I could grab all data and then just assign all private variables, but I assume there must be another "cheaper" way to get all the data so I can use as such</p>
  
  <p>$this->variable;</p>
  
  <p>And not have to ASSIGN every single data row, I select in the load method. How?</p>