title: converting union sql query to cakehp array method
body: <p>This is a very straight forward question and don't expect code but possibly a pointer to a good tutorial or some tips as I have no clue.. I am attempting to put this query in cakephp's array method when calling from the database. </p>
  
  <pre><code>SELECT thickness, colto_section, Position
  FROM (
  
  SELECT thickness, colto_section,base_layers.position AS Position
  FROM base_layers
  WHERE base_layers.section_id =1
  UNION 
  SELECT thickness, colto_section,selects.position
  FROM selects
  WHERE selects.section_id =1
  UNION 
  SELECT thickness, colto_section,subbases.position
  FROM subbases
  WHERE subbases.section_id =1
  )x
  ORDER BY Position ASC 
  </code></pre>
  
  <p>Thanks, even just to declare union in the array will help xD.</p>
  
  <p>Edit: this code provided is working 100%.</p>
  
  <p>update:</p>
  
  <p>What I am attempting to do.
  I have 3 tables, with some similar data eg. thickness, colto_section, Position.
  each table represents a different layer of a road, and needs to be in order so
  that we know which to put first. usually base_layer is first but after that it
  can be anything. so....</p>
  
  <p>The codes query I have done, does exactly this.
  I could go do this->query(); but that defeats the point
  of cakephp's framework and security. so trying to find out
  if there is a way to bring the union into Cakephp's array 
  method of calling data from the database. </p>
  
  <p>So main question is can this query be converted to Cakephp's
  array method? if so, a tip pls ;)</p>
  
  <p>(excuse repetition, trying to be thorough)</p>