Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
breakoutModewide
languagephp
$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
languagephp
$model = KenedoModel::getModel('ConfigboxModelProducts');

...



$filters = array('published' => '1', 'title' => 'Car');

...


$ordering = array( array('propertyName'=>'title', 'direction' => 'ASC'));

...



$products = $model->getRecords($filters, array(), $ordering);