Skip to content

Commit

Permalink
Add get Session Description method - refs BT#9092
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Barreto committed Feb 11, 2015
1 parent 4a54393 commit 0fc2e8c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions main/inc/lib/sessionmanager.lib.php
Expand Up @@ -5649,4 +5649,32 @@ public static function getSessionListAndExtraByCategoryId($sessionCategoryId)
return $errorResult;
}
}

/**
* Return session description from
* @param int $sessionId
* @return string
*/
public static function getDescriptionFromSessionId($sessionId)
{
$sessionId = intval($sessionId);
$description = '';
if ($sessionId !== 0) {
$rows = Database::select(
'description',
Database::get_main_table(TABLE_MAIN_SESSION),
array(
'where' => array(
'id = ?' => $sessionId
)
)
);

if (!empty($rows)) {
$description = $rows[0]['description'];
}
}

return $description;
}
}

0 comments on commit 0fc2e8c

Please sign in to comment.