title: Is this good practice for encapsulation in PHP?
body: <p>For instance i have class say that runs MySQL query and i want to encapsulate this class.</p>
  
  <pre><code>class SqlQuery {
  
    private $database_connection_obj;
  
    public function __construct($dbh) {
       $this-&gt;$database_connection_obj = $dbh;
    }
  
    public function runQuery($query, $params) {
  
       //run query implementation...
  
    }
  
  }
  </code></pre>
  
  <p>Encapsulation and information hiding means that i want to close direct access to class methods so function <code>runQuery()</code> should not be public so i make it private and add method <code>exacuteQuery()</code> with sole purpose to pass data to private function <code>runQuery()</code>. </p>
  
  <p>What is the practical use of doing so, because at the end it works exact same as code above.
  Should there be some sanitation of input data done in public method before its passed to private method or why write this extra code at all? </p>
  
  <pre><code>class SqlQuery {
  
    private $database_connection_obj;
  
    public function __construct($dbh) {
       $this-&gt;$database_connection_obj = $dbh;
    }
  
    public function exacuteQuery($external_query, $external_params) {
       $this-&gt;runQuery($external_query, $external_params);
    }    
  
    private function runQuery($query, $params) {
  
       //run query implementation...
  
    }
  
  }
  </code></pre>