PHP Templating API: getModels()
Posted by Mark [Elevated X Support], Last modified by Mark [Elevated X Support] on 10 March 2021 04:25 PM
|
|
Description:The getModels() function gets a list of models that are present in the system. Based on the arguments that are passed to it will determine which and how many models are returned. Sample Usage:$modelobj = $api->getModels(); Returning Attributes:This function call will return a StdObject object with the following attributes: models:This is a multi-dimensional array that returns any models that match search criteria. modelcount:The number of sets within the models attribute. numpages:A total number of pages that are available. For instance, if modeltotal = 400 and the system has a numperpage value of 20, this value will be 20. modeltotal:A total number of models that are available, regardless of pagination. Arguments:page:This paginates the model list. This way, if you specify "page" => 2, it will show a different list of models than if you specify "page" => 1. id:This filters the results by model id. If set, this will only return a set of the specified model id, if it is available for release and is present on the current site. numperpage:If specified, determines the maximum number of results to show. gender:If specified, only return models that belong to the specified gender. startwith:If specified, only show models that begin with the specified letter. sort:Specify sorting order of sets. sort_reverse:If this is set to 1, reverse the sorting order as specified within "sort" subsiteid: If specified, limit models belonging to a specified all-access subsite id. If this value is set to 0, show sets from all sites. extrafield_filter:If specified, limit models based on extra field search criteria. In order to do a search with this, you'll need to pass an associative array, where: - The key specifies the Extra Field Id of the item you're searching. You can find this ID in /cms_admin/plugins/extrafields/extrafields.php - The value of the array is an exact match of the string that you're searching. Examples:
| |
|