[prev in list] [next in list] [prev in thread] [next in thread] 

List:       horde-dev
Subject:    Re: [dev] Turba API searchClients()
From:       Jan Schneider <jan () horde ! org>
Date:       2011-09-26 7:19:50
Message-ID: 20110926091950.Horde.v2kHDxPcj3hOgCeWigMlaPA () neo ! wg ! de
[Download RAW message or body]


Zitat von Luis Felipe Marzagao <lfbm.andamentos@gmail.com>:

> Hello:
>
> I just noticed that:
>
> $registry->contacts->searchClients(array(null));
>
> or
>
> $registry->contacts->searchClients(array(''));
>
> Returns a nested array with *all* clients, with this kind of array set:
>
> Array
> (
>     [] => Array
>         (
>             [0] => Array
>                 (
>                     [__key] => ....
>                     ...
>                     [name] => John Doe
>                     ....
>                 )
>             [1] => Array
>                 (
>                     [__key] => ....
>                     ...
>                     [name] => Jane Smith
>                     ....
>                 )
>             ...
>     )
> )
>
> The key of the first array is empty "[]", as this was supposed to  
> hold the filter search criteria, which, in this example, was not  
> supplied with the searchClients method.

It was supplied. If you didn't supply it you would have called the  
method with array().

> So:
>
> 1 - Is this the recommended way of retrieving all clients of  
> returning all clients or is it just an accident?

Yes, that's how it supposed to work.

> 2 - If it is the recommended way, shouldn´t the first key be set to  
> something like 'all-clients', instead of an empty key, just to make  
> it easier to read or easier to manipulate?

No.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/

-- 
Horde developers mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: dev-unsubscribe@lists.horde.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic