/**
* Gets an issues list based on the given parameters.
*
* @param integer $p_context_id
* The Context Box Identifier
* @param string $p_order
* An array of columns and directions to order by
* @param integer $p_start
* The record number to start the list
* @param integer $p_limit
* The offset. How many records from $p_start will be retrieved.
* @param integer $p_count
* The total count of the elements; this count is computed without
* applying the start ($p_start) and limit parameters ($p_limit)
*
* @return array $issuesList
* An array of Issue objects
*/
public static function GetList($p_context_id, $p_order = null, $p_start = 0, $p_limit = 0, &$p_count, $p_skipCache = false)
{
global $g_ado_db;
if (!$p_skipCache && CampCache::IsEnabled()) {
$paramsArray['parameters'] = serialize($p_parameters);
$paramsArray['order'] = is_null($p_order) ? 'id desc' : $p_order;
$paramsArray['start'] = $p_start;
$paramsArray['limit'] = $p_limit;
$cacheListObj = new CampCacheList($paramsArray, __METHOD__);
$issuesList = $cacheListObj->fetchFromCache();
if ($issuesList !== false && is_array($issuesList)) {
return $issuesList;
}
}
$returnArray = array();
$sql = 'SELECT fk_article_no FROM context_articles
WHERE fk_context_id = ' . $p_context_id . '
ORDER BY id desc';
$rows = $g_ado_db->GetAll($sql);
if (is_array($rows)) {
foreach ($rows as $row) {
$returnArray[] = $row['fk_article_no'];
}
}
$p_count = count($returnArray);
return array_reverse($returnArray);
}