...
Code Block | ||||
---|---|---|---|---|
| ||||
$model = KenedoModel::getModel('ConfigboxModelProducts'); $products = $model->getRecords(); // Returns data of all ConfigBox products with no filters or specific ordering. $products = $model->getRecords(); // with all parameters (see descriptions below) $products = $model->getRecords($filters, $pagination, $ordering, $languageTag); // see below |
Parameters
Filtering
First parameter is $filters. It defaults to an empty array and makes the method return any records it finds.
...
Loading all products that are published and have 'Car' in their title and order them by title.
Code Block | ||
---|---|---|
| ||
$model = KenedoModel::getModel('ConfigboxModelProducts'); |
...
$filters = array('published' => '1', 'title' => 'Car'); |
...
$ordering = array( array('propertyName'=>'title', 'direction' => 'ASC')); |
...
$products = $model->getRecords($filters, array(), $ordering); |