You are here

public function InstapageCmsPluginPageModel::getAll in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/models/InstapageCmsPluginPageModel.php \InstapageCmsPluginPageModel::getAll()

Gets all the stored pages.

Parameters

array $fields Fields to retrieve. Default: array('*').:

array $conditions. List of conditions. Logical operator between conditions: AND.:

Return value

array Lst of results.

File

core/models/InstapageCmsPluginPageModel.php, line 67

Class

InstapageCmsPluginPageModel
Class responsible for managing the landing pages.

Code

public function getAll($fields = array(
  '*',
), $conditions = array()) {
  $db = InstapageCmsPluginDBModel::getInstance();
  $sql = 'SELECT ' . implode(', ', $fields) . ' FROM ' . $db->pagesTable;
  if (count($conditions)) {
    $sql .= ' WHERE ' . implode(' AND ', $conditions);
  }
  return $db
    ->getResults($sql);
}