Skip to content

Commit

Permalink
docblock for get_from_to
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Nov 13, 2023
1 parent cc5b934 commit d48b350
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ function get_table_data(\stdClass $driprelease) : array {
if (isset($driprelease->id)) {
$selections = $DB->get_records_menu('tool_driprelease_cmids', ['driprelease' => $driprelease->id],
null, 'id,coursemoduleid');
// $cmids = $DB->get_records_menu('tool_driprelease_cmids', ['driprelease' => $driprelease->id],'','coursemoduleid,id');
}
foreach ($modules as $cm) {
$row['selected'] = in_array($cm->id, $selections) ? 'checked' : "";
Expand Down Expand Up @@ -207,7 +206,14 @@ function get_table_data(\stdClass $driprelease) : array {
}
return $data ?? [];
}
function get_from_to($availability) {
/**
* Get from and to dates as unixtimestamps
*
* @param string $availability // In json format.
* @return array // Two elements from and in unixtime format
*/
function get_from_to(string $availability) :array {

$ob = json_decode($availability);
if (!$ob) {
return [];
Expand Down

0 comments on commit d48b350

Please sign in to comment.