I have been attempting to structure an array using the set::combine method, and I cannot get it working (what am I doing wrong!).
And I will note I need to turn this into an associative array like:
[Tree] => Array
(
[id] => 1
[name] => Pine
)...
Here is an example of my Array:
Array
(
[1] => Array
(
[1] => Array
(
[Tree] => Array
(
[id] => 1
[name] => Pine
)
)
)...
And here is my set::combine call:
$combine = Set::combine($this->data,'{n}.Tree.id','{n}.Tree.name');
debug($combine);
And here is the debug output of $combine:
Array
(
[] =>
)
I can do:
$combine = Set::combine($this->data,'{n}.{n}.Tree.id','{n}.{n}.Tree.name');
But I still get the numeric index!
Array
(
[Array] => Array
(
[0] => Oak nnn
)
)
I've tried every example and have been over the manual section on combine all evening. Can't get this working : (