Criteria
Last updated
Last updated
The XOOPS API has a class called Criteria to aid in database searches. The class is defined as such:
It's handy for returning a list of objects from the XoopsPersistableObjectHandler class. Example:
This returns $array as an array of all elements following the criteria! If the third argument of the getObjects method is true, it returns objects instead, handy for bulk manipulation!
The Criteria class only handles a single 'WHERE' condition. If you need multiple conditions, use CriteriaCompo in combination with Criteria. Here is an example out of the mailusers file:
If you have just a few simple conditions, you can just use