Sunday, October 26, 2008

Re: Set::extract issue - array must start with [0] index

I have noticed this to. Forget to post a ticket for enhancements, my
solution for now was to re-index the array.

On Oct 25, 7:33 pm, senser <nikolay.engyo...@gmail.com> wrote:
> Hello,
>
> I have problem using Set::extract class. Here is an example array
> $test:
>
> Array
> (
> [3181] => Array
> (
> [Sync] => Array
> (
> [id] => 3181
> [synced] => 0
> )
> )
>
> On this array Set::extract('/Sync[id=3181]', $test) returns an empty
> result but if I change the array like this
>
> Array
> (
> [0] => Array
> (
> )
> [3181] => Array
> (
> [Sync] => Array
> (
> [id] => 3181
> [synced] => 0
> )
> )
>
> and Set::extract('/Sync[id=3181]', $test) gives the right result. My
> conclusion is that Set:extract needs the first element of an array to
> be with zero index - am I wrong or missing something.
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: