Re: "where" clause in dynamicdata getitems

Marty Vance <[email protected]> Tue, 07 Oct 2008 20:39:08 -0600
Newsgroups gmane.comp.cms.xaraya.user
Organization Xaraya
Message-ID <[email protected]>
Ryan Walker wrote:
> Hi all,
> 
> I can't figure out the syntax for a "where" clause in the following 
> example...
> 
> <xar:set name="where">'signed_up_as eq \'org\''</xar:set>
> <xar:set 
> name="items">xarmodapifunc('dynamicdata','user','getitems',array('modid' 
> => 151, 'itemtype' => 61, 'where' => $where))</xar:set>
> <xar:foreach in="$items" key="$key" value="$val">
> <xar:set name="$aids[]">$key</xar:set>
> </xar:foreach>
> <xar:set name="pop">array_pop($aids)</xar:set>
> <xar:set 
> name="org_signers">xarmodapifunc('articles','user','getall',array('ptid' 
> => 61, 'fields' => array('title','summary','dynamicdata'), 'aids' => 
> $aids, 'sort' => 'title ASC', 'where' => 'status eq 2'))</xar:set>
> 
> I've tried the following...
> 
> <xar:set name="where">'signed_up_as eq \'org\''</xar:set>
> 
> <xar:set name="where">'signed_up_as = \'org\''</xar:set>
> 
> <xar:set name="where">'signed_up_as eq org'</xar:set>
> 
> <xar:set name="where">'dd_534 eq \'org\''</xar:set>
> 

It looks like you're tring to do the same thing via articles and dd.

artices_userapi_getall has a param that you may have overlooked: 
wheredd.  The where param doesn't work for dd fields.

<xar:set 
name="org_signers">xarmodapifunc('articles','user','getall',array('ptid' 
=> 61, 'fields' => array('title','summary','dynamicdata'), 'aids' => 
$aids, 'sort' => 'title ASC', 'where' => 'status eq 2', 'wheredd' => 
'signed_up_as eq \'org\''))</xar:set>

I don't think I've ever used wheredd, but that should work if I 
understand correctly what you're doing.