title: Different find results between cakephp 2.5 and 3.0
body: <p>I am migrating my app from cakephp 2.5 to 3.0 and I am doing a <code>-&gt;find()</code> method and then looping over the results in the controller. However I am getting different results returned in 3.0. I seem to be getting the query settings that cakephp uses before going to the database rather than the results.</p>
  
  <p>EmployeesController.php</p>
  
  <p>2.5 Code:</p>
  
  <pre><code>//Open courses
  $options = array(
      'conditions' =&gt; array('Employee.id' =&gt; 1, 'CoursesEmployee.completed' =&gt; false),
      'limit' =&gt; 3
      );
  $recentOpen = $this-&gt;CoursesEmployee-&gt;find('all', $options);
  debug($recentOpen);
  
  // get next module for each open course
  foreach ($recentOpen as $key =&gt; &amp;$value) {
      //do something
  }
  </code></pre>
  
  <p>and the results:</p>
  
  <pre><code>array(
  (int) 0 =&gt; array(
      'CoursesEmployee' =&gt; array(
          'id' =&gt; '1',
          'employee_id' =&gt; '1',
          'course_id' =&gt; '1',
          'course_module_id' =&gt; '5',
          'progress' =&gt; '10',
          'modified' =&gt; '2014-12-16 22:40:42',
          'created' =&gt; '2014-11-18 00:00:00',
          'completed' =&gt; false
      ),
      'Employee' =&gt; array(
          'id' =&gt; '1',
          'user_id' =&gt; '1',
          'hotel_id' =&gt; '1',
          'name' =&gt; 'Keith Power',
          'email' =&gt; '',
          'surname' =&gt; 'Power',
          'employee_num' =&gt; '',
          'modified' =&gt; '2014-11-19 12:52:36',
          'created' =&gt; '2014-11-18 00:00:00'
      ),
      'Course' =&gt; array(
          'id' =&gt; '1',
          'name' =&gt; 'Manual Handling Training',
          'course_lenght' =&gt; '02:12:00'
      ),
      'CourseModule' =&gt; array(
          'id' =&gt; '5',
          'course_id' =&gt; '1',
          'name' =&gt; 'Module 5',
          'type' =&gt; 'video',
          'video_url' =&gt; '',
          'video_lenght' =&gt; '00:00:00'
      )
  ),
  (int) 1 =&gt; array(
      'CoursesEmployee' =&gt; array(
          'id' =&gt; '3',
          'employee_id' =&gt; '1',
          'course_id' =&gt; '2',
          'course_module_id' =&gt; '5',
          'progress' =&gt; '100',
          'modified' =&gt; '2014-12-05 15:13:47',
          'created' =&gt; '2014-11-20 00:00:00',
          'completed' =&gt; false
      ),
      'Employee' =&gt; array(
          'id' =&gt; '1',
          'user_id' =&gt; '1',
          'hotel_id' =&gt; '1',
          'name' =&gt; 'Keith Power',
          'email' =&gt; '',
          'surname' =&gt; 'Power',
          'employee_num' =&gt; '',
          'modified' =&gt; '2014-11-19 12:52:36',
          'created' =&gt; '2014-11-18 00:00:00'
      ),
      'Course' =&gt; array(
          'id' =&gt; null,
          'name' =&gt; null,
          'course_lenght' =&gt; null
      ),
      'CourseModule' =&gt; array(
          'id' =&gt; '5',
          'course_id' =&gt; '1',
          'name' =&gt; 'Module 5',
          'type' =&gt; 'video',
          'video_url' =&gt; '',
          'video_lenght' =&gt; '00:00:00'
      )
    )
  )
  </code></pre>
  
  <p>3.0 Code:</p>
  
  <pre><code>$this-&gt;loadModel('CoursesEmployees');
  
  //Open courses
  $options = [
      'conditions' =&gt; ['Employees.id' =&gt; 1, 'CoursesEmployees.completed' =&gt; false],
      'limit' =&gt; 3,
      'contain' =&gt; 'Employees'
  ];
  $recentOpen = $this-&gt;CoursesEmployees-&gt;find('all', $options)-&gt;toArray();
  
  debug($recentOpen);
  </code></pre>
  
  <p>But I do not get results returned expected, the actual values seem contained inside an array called <code>properties</code> there is no mention the in cake book about accessing properties:</p>
  
  <pre><code>[
  (int) 0 =&gt; object(App\Model\Entity\CoursesEmployee) {
  
      'new' =&gt; false,
      'accessible' =&gt; [
          'employee_id' =&gt; true,
          'course_id' =&gt; true,
          'course_module_id' =&gt; true,
          'progress' =&gt; true,
          'completed' =&gt; true,
          'employee' =&gt; true,
          'course' =&gt; true,
          'course_module' =&gt; true
      ],
      'properties' =&gt; [
          'id' =&gt; (int) 1,
          'employee_id' =&gt; (int) 1,
          'course_id' =&gt; (int) 1,
          'course_module_id' =&gt; (int) 5,
          'progress' =&gt; (int) 10,
          'modified' =&gt; object(Cake\I18n\Time) {
  
              'time' =&gt; '2014-12-16T22:40:42+0000',
              'timezone' =&gt; 'UTC',
              'fixedNowTime' =&gt; false
  
          },
          'created' =&gt; object(Cake\I18n\Time) {
  
              'time' =&gt; '2014-11-18T00:00:00+0000',
              'timezone' =&gt; 'UTC',
              'fixedNowTime' =&gt; false
  
          },
          'completed' =&gt; false,
          'employee' =&gt; object(App\Model\Entity\Employee) {
  
              'new' =&gt; false,
              'accessible' =&gt; [
                  'user_id' =&gt; true,
                  'hotel_id' =&gt; true,
                  'name' =&gt; true,
                  'email' =&gt; true,
                  'surname' =&gt; true,
                  'employee_num' =&gt; true,
                  'hotel' =&gt; true,
                  'courses' =&gt; true
              ],
              'properties' =&gt; [
                  'id' =&gt; (int) 1,
                  'user_id' =&gt; (int) 1,
                  'hotel_id' =&gt; (int) 1,
                  'name' =&gt; 'Keith Power',
                  'email' =&gt; '',
                  'surname' =&gt; 'Power',
                  'employee_num' =&gt; '',
                  'modified' =&gt; object(Cake\I18n\Time) {
  
                      'time' =&gt; '2014-11-19T12:52:36+0000',
                      'timezone' =&gt; 'UTC',
                      'fixedNowTime' =&gt; false
  
                  },
                  'created' =&gt; object(Cake\I18n\Time) {
  
                      'time' =&gt; '2014-11-18T00:00:00+0000',
                      'timezone' =&gt; 'UTC',
                      'fixedNowTime' =&gt; false
  
                  }
              ],
              'dirty' =&gt; [],
              'original' =&gt; [],
              'virtual' =&gt; [],
              'errors' =&gt; [],
              'repository' =&gt; 'Employees'
  
          }
      ],
      'dirty' =&gt; [],
      'original' =&gt; [],
      'virtual' =&gt; [],
      'errors' =&gt; [],
      'repository' =&gt; 'CoursesEmployees'
  
  },
  (int) 1 =&gt; object(App\Model\Entity\CoursesEmployee) {
  
      'new' =&gt; false,
      'accessible' =&gt; [
          'employee_id' =&gt; true,
          'course_id' =&gt; true,
          'course_module_id' =&gt; true,
          'progress' =&gt; true,
          'completed' =&gt; true,
          'employee' =&gt; true,
          'course' =&gt; true,
          'course_module' =&gt; true
      ],
      'properties' =&gt; [
          'id' =&gt; (int) 3,
          'employee_id' =&gt; (int) 1,
          'course_id' =&gt; (int) 2,
          'course_module_id' =&gt; (int) 5,
          'progress' =&gt; (int) 100,
          'modified' =&gt; object(Cake\I18n\Time) {
  
              'time' =&gt; '2014-12-05T15:13:47+0000',
              'timezone' =&gt; 'UTC',
              'fixedNowTime' =&gt; false
  
          },
          'created' =&gt; object(Cake\I18n\Time) {
  
              'time' =&gt; '2014-11-20T00:00:00+0000',
              'timezone' =&gt; 'UTC',
              'fixedNowTime' =&gt; false
  
          },
          'completed' =&gt; false,
          'employee' =&gt; object(App\Model\Entity\Employee) {
  
              'new' =&gt; false,
              'accessible' =&gt; [
                  'user_id' =&gt; true,
                  'hotel_id' =&gt; true,
                  'name' =&gt; true,
                  'email' =&gt; true,
                  'surname' =&gt; true,
                  'employee_num' =&gt; true,
                  'hotel' =&gt; true,
                  'courses' =&gt; true
              ],
              'properties' =&gt; [
                  'id' =&gt; (int) 1,
                  'user_id' =&gt; (int) 1,
                  'hotel_id' =&gt; (int) 1,
                  'name' =&gt; 'Keith Power',
                  'email' =&gt; '',
                  'surname' =&gt; 'Power',
                  'employee_num' =&gt; '',
                  'modified' =&gt; object(Cake\I18n\Time) {
  
                      'time' =&gt; '2014-11-19T12:52:36+0000',
                      'timezone' =&gt; 'UTC',
                      'fixedNowTime' =&gt; false
  
                  },
                  'created' =&gt; object(Cake\I18n\Time) {
  
                      'time' =&gt; '2014-11-18T00:00:00+0000',
                      'timezone' =&gt; 'UTC',
                      'fixedNowTime' =&gt; false
  
                  }
              ],
              'dirty' =&gt; [],
              'original' =&gt; [],
              'virtual' =&gt; [],
              'errors' =&gt; [],
              'repository' =&gt; 'Employees'
  
          }
      ],
      'dirty' =&gt; [],
      'original' =&gt; [],
      'virtual' =&gt; [],
      'errors' =&gt; [],
      'repository' =&gt; 'CoursesEmployees'
  
  }
  ]
  </code></pre>
  
  <p>Is there another step required in 3.0. It is finding the two records in both, but the format of 3.0 is so different I don't know how to access the values like I did in 2.5 to do my loop.</p>
  
  <p>*****Update</p>
  
  <p>As suggested I have updated to Cakephp 3.05. Now all the extra properties are hidden and I am left with the results in object form. I am using <code>-&gt;toArray()</code> but it does not seem to change the object.</p>
  
  <pre><code>[
  (int) 0 =&gt; object(App\Model\Entity\CoursesEmployee) {
  
      'id' =&gt; (int) 1,
      'employee_id' =&gt; (int) 1,
      'course_id' =&gt; (int) 1,
      'course_module_id' =&gt; (int) 5,
      'progress' =&gt; (int) 10,
      'modified' =&gt; object(Cake\I18n\Time) {
  
          'time' =&gt; '2014-12-16T22:40:42+0000',
          'timezone' =&gt; 'UTC',
          'fixedNowTime' =&gt; false
  
      },
      'created' =&gt; object(Cake\I18n\Time) {
  
          'time' =&gt; '2014-11-18T00:00:00+0000',
          'timezone' =&gt; 'UTC',
          'fixedNowTime' =&gt; false
  
      },
      'completed' =&gt; false,
      '[new]' =&gt; false,
      '[accessible]' =&gt; [
          'employee_id' =&gt; true,
          'course_id' =&gt; true,
          'course_module_id' =&gt; true,
          'progress' =&gt; true,
          'completed' =&gt; true,
          'employee' =&gt; true,
          'course' =&gt; true,
          'course_module' =&gt; true
      ],
      '[dirty]' =&gt; [],
      '[original]' =&gt; [],
      '[virtual]' =&gt; [],
      '[errors]' =&gt; [],
      '[repository]' =&gt; 'CoursesEmployees'
  
  },
  (int) 1 =&gt; object(App\Model\Entity\CoursesEmployee) {
  
      'id' =&gt; (int) 2,
      'employee_id' =&gt; (int) 1,
      'course_id' =&gt; (int) 3,
      'course_module_id' =&gt; (int) 8,
      'progress' =&gt; (int) 100,
      'modified' =&gt; object(Cake\I18n\Time) {
  
          'time' =&gt; '2014-12-08T00:07:18+0000',
          'timezone' =&gt; 'UTC',
          'fixedNowTime' =&gt; false
  
      },
      'created' =&gt; object(Cake\I18n\Time) {
  
          'time' =&gt; '2014-11-20T00:00:00+0000',
          'timezone' =&gt; 'UTC',
          'fixedNowTime' =&gt; false
  
      },
      'completed' =&gt; true,
      '[new]' =&gt; false,
      '[accessible]' =&gt; [
          'employee_id' =&gt; true,
          'course_id' =&gt; true,
          'course_module_id' =&gt; true,
          'progress' =&gt; true,
          'completed' =&gt; true,
          'employee' =&gt; true,
          'course' =&gt; true,
          'course_module' =&gt; true
      ],
      '[dirty]' =&gt; [],
      '[original]' =&gt; [],
      '[virtual]' =&gt; [],
      '[errors]' =&gt; [],
      '[repository]' =&gt; 'CoursesEmployees'
  
  }]
  </code></pre>