title: Cakephp using an array variable in a find operation
body: <p>I am creating a shortlist which is stored in a cake Session variable </p>
  
  <pre><code>$this-&gt;Session-&gt;read('Item.shorlist');
  </code></pre>
  
  <p>This contains a list of comma separated IDs eg. 1,2,3,4,5</p>
  
  <pre><code>$shortlist =  $this-&gt;Session-&gt;read('Item.shorlist');
  </code></pre>
  
  <p>I would like to perform a find operation using the comma separated IDs in this variable in the find conditions eg:</p>
  
  <pre><code>$shortlist = $this-&gt;Item-&gt;find('all', array('conditions' =&gt; array('Item.id' =&gt; array($shortlist))));
  </code></pre>
  
  <p>However, this only returns 1 set of data.
  If I manually put in an array eg:</p>
  
  <pre><code>$shortlist = $this-&gt;Item-&gt;find('all', array('conditions' =&gt; array('Item.id' =&gt; array(1,2,3,4,5))));
  </code></pre>
  
  <p>I get all 5 records returned.</p>
  
  <p>Any ideas how to get around this without performing multiple finds on each id? If I look at the SQL dump I can see WHERE <code>Item</code>.<code>id</code> = ('1,2,3,4,5') using the $shortlist variable whereas if I input it manually as comma delimited integers eg: WHERE <code>Item</code>.<code>id</code> IN (1, 2, 3, 4) then the sql query works as I would like it to.
  So I guess my question is how to convert a comma delimited string to comma separated integers within a variable so that the SQL does not throw an error?</p>