{oids:type:modules:conds:sort:delimiter:restrict_ids:limit}

Description

Returns the long ids of stored OBJECTS of a given type, filtered by conditions and ordered, as a delimiter-joined list. Objects live in AA general object store (the object_ tables), separate from slice items, so oids is the object-store counterpart of ids: feed its output to oitem to display the matching objects. The only object type AA currently supports is datovka (records of messages sent to Czech state data boxes by the datovka command), so type must be datovka; any other or unknown type returns an empty string. With no modules given, the search is scoped to the object types owned by the current site; pass slice or module ids to widen or narrow it. conds is a d- string of field-operator-value triplets over the object fields (for datovka these include state, conf, dbIDRecipient and the dm envelope fields); sort takes one or more object field names, ascending by default or descending with a trailing dash. restrict_ids intersects the search with a known id set, limit caps the count (a negative limit returns the last N), and delimiter joins the ids (default a dash, or json for a JSON array). With no matching object the result is an empty string. Note: always supply the type - calling oids with no arguments at all raises a PHP error rather than returning empty.

Parameters

type required default (none)

Object type to search. Required. AA currently supports only datovka (records of messages sent to Czech state data boxes). Any other or unknown value returns an empty string; passing no arguments at all to oids raises a PHP error, so always give the type.

modules optional default related modules of the current site

Slice or module ids (dash-separated) whose objects to search. Empty means the object owners related to the current site. Pass ids to widen or narrow the scope.

conds optional default (none)

A d- condition string of field-operator-value triplets over the object fields. For datovka the fields include state, conf, dbIDRecipient and the dm envelope fields, for example d-state-==-1 to keep only sent messages.

sort optional default (none)

Object field name(s) to order the result by, ascending by default or descending with a trailing dash, for example state- to sort by state descending. Several fields may be combined.

delimiter optional default dash -

String placed between the returned ids. Defaults to a dash. Use json to get the ids as a JSON array instead. With no matching object the result is an empty string regardless of delimiter.

restrict_ids optional default (none)

A known set of object ids to intersect the search with. The result keeps only objects that are both in this set and match the other conditions. Empty means no restriction.

limit optional default 0 (all)

Caps the number of ids returned. A positive value keeps the first N, a negative value keeps the last N. Zero or empty returns all matches.

Examples

test{oids:unknown}
Only the datovka object type is supported. Any other or unknown type returns an empty string instead of an error - a safe way to probe. (Never call oids with no arguments at all: that raises a PHP error.)
virtual{oids:datovka}
Expected(dash-joined long ids of the datovka messages owned by the current site, or empty when there are none)
With only the type given, oids returns every datovka object owned by the current site, as dash-separated long ids. The result depends on what messages exist, so this is install-dependent.
virtual{oids:datovka::d-state-==-1}
Expected(long ids of datovka messages whose state field equals 1, empty when none match)
The third parameter is a d- condition string over the object fields. Here it keeps only messages with state equal to 1. The second (modules) parameter is left empty to use the current site scope.
virtual{oids:datovka:::state-}
Expected(the same ids ordered by the state field descending)
The fourth parameter sorts the result by one or more object fields. A trailing dash on the field name (state-) means descending order.
virtual{oids:datovka::::json}
Expected(a JSON array of the matching long ids, for example ["a1b2..","c3d4.."]; empty string when none match)
The fifth parameter is the delimiter joining the ids. The special value json returns a JSON array instead of a dash-joined string - handy for feeding the ids into definejson or a script.
virtual{oids:datovka::::-::-3}
Expected(the last 3 matching long ids; a positive limit would keep the first N instead)
The seventh parameter caps the count. A negative value (-3) returns the LAST N ids, a positive value the first N. Here delimiter is left as a dash (the explicit - keeps the default) and modules, conds, sort and restrict_ids are empty.
virtual{oitem:datovka:{oids:datovka}:_#STATETXT:<br>}
Expected(one line per datovka message showing its human-readable state text; empty when there are no messages)
The canonical pairing: oids finds the object ids, oitem renders a field or alias of each. Here _#STATETXT prints the state label of every datovka message of the site, one per line. This is how you inspect what the datovka command has sent.