◆ __construct()
◆ fetchDataSet()
ilUserCertificateTableProvider::fetchDataSet |
( |
|
$userId, |
|
|
|
$params, |
|
|
|
$filter |
|
) |
| |
- Parameters
-
- Returns
- array
Definition at line 66 of file class.ilUserCertificateTableProvider.php.
References $data, PHPMailer\PHPMailer\$params, $query, $row, $title, and getOrderByPart().
68 $this->logger->info(sprintf(
'START - Fetching all active certificates for user: "%s"', $userId));
72 il_cert_user_cert.obj_type, 73 il_cert_user_cert.thumbnail_image_path, 74 il_cert_user_cert.acquired_timestamp, 77 il_cert_user_cert.obj_id, 78 (CASE WHEN (object_data.title IS NULL OR LENGTH(object_data.title) = 0) 80 CASE WHEN (object_data_del.title IS NULL OR LENGTH(object_data_del.title) = 0) 81 THEN ' . $this->database->quote($this->defaultTitle,
'text') .
' 82 ELSE object_data_del.title 84 ELSE object_data.title 87 (CASE WHEN (object_data.description IS NULL OR LENGTH(object_data.description) = 0) 89 CASE WHEN (object_data_del.description IS NULL OR LENGTH(object_data_del.description) = 0) 91 ELSE object_data_del.description 93 ELSE object_data.description 96 FROM il_cert_user_cert 97 LEFT JOIN object_data ON object_data.obj_id = il_cert_user_cert.obj_id 98 LEFT JOIN object_data_del ON object_data_del.obj_id = il_cert_user_cert.obj_id 99 LEFT JOIN usr_data ON usr_data.usr_id = il_cert_user_cert.user_id 100 WHERE user_id = ' . $this->database->quote($userId,
'integer') .
' AND currently_active = 1';
108 if (!is_numeric(
$params[
'limit'])) {
112 if (!isset(
$params[
'offset'])) {
115 if (!is_numeric(
$params[
'offset'])) {
123 $query = $this->database->query($sql);
130 while (
$row = $this->database->fetchAssoc(
$query)) {
133 $data[
'items'][] = array(
136 'obj_id' =>
$row[
'obj_id'],
137 'obj_type' =>
$row[
'obj_type'],
138 'date' =>
$row[
'acquired_timestamp'],
139 'thumbnail_image_path' =>
$row[
'thumbnail_image_path'],
140 'description' =>
$row[
'description'],
141 'firstname' =>
$row[
'firstname'],
142 'lastname' =>
$row[
'lastname'],
149 FROM il_cert_user_cert 150 WHERE user_id = ' . $this->database->quote($userId,
'integer') .
' AND currently_active = 1';
152 $row_cnt = $this->database->fetchAssoc($this->database->query($cnt_sql));
154 $data[
'cnt'] = $row_cnt[
'cnt'];
156 $this->logger->info(sprintf(
157 'All active certificates for user: "%s" total: "%s"',
165 $this->logger->debug(sprintf(
'END - Actual results:', json_encode(
$data)));
getOrderByPart(array $params, array $filter)
◆ getOrderByPart()
ilUserCertificateTableProvider::getOrderByPart |
( |
array |
$params, |
|
|
array |
$filter |
|
) |
| |
|
protected |
- Parameters
-
array | $params | |
array | $filter | |
- Returns
- string
Definition at line 175 of file class.ilUserCertificateTableProvider.php.
Referenced by fetchDataSet().
177 if (isset(
$params[
'order_field'])) {
178 if (!is_string(
$params[
'order_field'])) {
182 if (!in_array(
$params[
'order_field'], array(
'date',
'id',
'title'))) {
186 if (
$params[
'order_field'] ==
'date') {
187 $params[
'order_field'] =
'acquired_timestamp';
190 if (!isset(
$params[
'order_direction'])) {
191 $params[
'order_direction'] =
'ASC';
192 } elseif (!in_array(strtolower(
$params[
'order_direction']), array(
'asc',
'desc'))) {
196 return ' ORDER BY ' .
$params[
'order_field'] .
' ' .
$params[
'order_direction'];
◆ $controller
ilUserCertificateTableProvider::$controller |
|
private |
◆ $database
ilUserCertificateTableProvider::$database |
|
private |
◆ $defaultTitle
ilUserCertificateTableProvider::$defaultTitle |
|
private |
◆ $logger
ilUserCertificateTableProvider::$logger |
|
private |
◆ $objectHelper
ilUserCertificateTableProvider::$objectHelper |
|
private |
The documentation for this class was generated from the following file: