title: How to Join multiple tables in PHALCON FRAMEWORK
body: <p>I am trying to join two tables(MYSQL) in <strong>Phalcon framework</strong>.</p>
  
  <p>"<strong>Table</strong>" names:</p>
  
  <pre><code>user
  contact_details
  </code></pre>
  
  <p>"<strong>Model</strong>" names:</p>
  
  <pre><code>User
  ContactDetails
  </code></pre>
  
  <p><strong>Initialize</strong>:</p>
  
  <pre><code>In "User" model -----&gt;$this-&gt;hasMany("id", "ContactDetails", "user_id"); 
  In "ContactDetails" model-----&gt;$this-&gt;belongsTo("user_id", "User", "id");
  </code></pre>
  
  <p><strong>My code</strong>:</p>
  
  <pre><code>public function userDetails(){             
        $phql = "SELECT User.*, ContactDetails.* FROM User LEFT JOIN ContactDetails";
        $user = $this-&gt;modelsManager-&gt;executeQuery($phql);
        -------
        -------Remaining code---------
        --------------
        }
  Thanks in advance.
  </code></pre>