title: Cake PHP: 3.0- Use of Collections
body: <p>Am new to Cake PHP and MVC, I <a href="http://book.cakephp.org/3.0/en/core-libraries/collections.html#Cake%5CCollection%5CCollection::shuffle" rel="nofollow">read this </a> tutorial for Collections given in Cake book. When I call this code from the Controller(Sample Code) it returns like</p>
  
  <blockquote>
    <p>Cake\Collection\Collection Object ( ) </p>
  </blockquote>
  
  <p>Which should actually return like this [2, 3, 1]</p>
  
  <p>Please correct me, If I had return the code wrongly or any namespace has been left out</p>
  
  <p><strong>Sample Code</strong></p>
  
  <pre><code>   &lt;?php 
     namespace App\Controller;
     use Cake\ORM\TableRegistry;
     use Cake\Collection\Collection;
     class AdminController extends AppController 
     {
       public function collection()
        {
        $items = ['a' =&gt; 1, 'b' =&gt; 2, 'c' =&gt; 3];
        $collection = new Collection($items);
  
  
        // This could return [2, 3, 1]
        $collection-&gt;shuffle()-&gt;toArray();
        print_r($collection); exit;
       }
      } 
     ?&gt;
  </code></pre>