Cakephp Find Fields

cakephp, cakephp-1.3, php

Solution

I think you have a extra array being formed. Try this:

public function findPolicyIds($coverageId = null) {   
$id = $this->Policy->find('all', array(
'recursive' => -1,
'fields' => array('Policy.id')));

return $id;
}

Code untested.

Problem

I am trying to retrieve one column per record by way of the find(). When I execute my code It returns all the fields in the table. Here is my code. What is wrong with my code? I am using Cakephp 1.3. ``` public function findPolicyIds($coverageId = null) { $id = $this->Policy->find('all', array( 'recursive' => -1, array( 'fields' => array('Policy.id')))); return $id; } ```

Original source