ILIAS  release_8 Revision v8.24
class.ilExcIndividualDeadline.php
Go to the documentation of this file.
1<?php
2
25{
26 protected int $participant_id;
27 protected bool $is_team;
28 protected int $ass_id;
29 protected ilDBInterface $db;
30 protected int $starting_timestamp = 0;
31 protected int $individual_deadline = 0;
32
33 protected function __construct(
34 int $a_ass_id,
35 int $a_participant_id,
36 bool $a_is_team
37 ) {
38 global $DIC;
39 $this->participant_id = $a_participant_id;
40 $this->is_team = $a_is_team;
41 $this->ass_id = $a_ass_id;
42 $this->db = $DIC->database();
43 $this->read();
44 }
45
46 public static function getInstance(
47 int $a_ass_id,
48 int $a_participant_id,
49 bool $a_is_team = false
51 return new self($a_ass_id, $a_participant_id, $a_is_team);
52 }
53
54 public function setStartingTimestamp(int $a_val): void
55 {
56 $this->starting_timestamp = $a_val;
57 }
58
59 public function getStartingTimestamp(): int
60 {
61 return $this->starting_timestamp;
62 }
63
64 public function setIndividualDeadline(int $a_val): void
65 {
66 $this->individual_deadline = $a_val;
67 }
68
69 public function getIndividualDeadline(): int
70 {
71 return $this->individual_deadline;
72 }
73
74 public function read(): void
75 {
76 $ilDB = $this->db;
77
78 $set = $ilDB->query(
79 "SELECT * FROM exc_idl " .
80 " WHERE ass_id = " . $this->db->quote($this->ass_id, "integer") .
81 " AND member_id = " . $this->db->quote($this->participant_id, "integer") .
82 " AND is_team = " . $this->db->quote($this->is_team, "integer")
83 );
84 if ($rec = $this->db->fetchAssoc($set)) {
85 $this->setIndividualDeadline((int) $rec["tstamp"]);
86 $this->setStartingTimestamp((int) $rec["starting_ts"]);
87 }
88 }
89
90 public function save(): void
91 {
92 $ilDB = $this->db;
93
94 $ilDB->replace(
95 "exc_idl",
96 array(
97 "ass_id" => array("integer", $this->ass_id),
98 "member_id" => array("integer", $this->participant_id),
99 "is_team" => array("integer", $this->is_team)
100 ),
101 array(
102 "tstamp" => array("integer", $this->getIndividualDeadline()),
103 "starting_ts" => array("integer", $this->getStartingTimestamp())
104 )
105 );
106 }
107
108 public function delete(): void
109 {
110 $ilDB = $this->db;
111
112 $ilDB->manipulate(
113 "DELETE FROM exc_idl " .
114 " WHERE ass_id = " . $this->db->quote($this->ass_id, "integer") .
115 " AND member_id = " . $this->db->quote($this->participant_id, "integer") .
116 " AND is_team = " . $this->db->quote($this->is_team, "integer")
117 );
118 }
119
120
127 public static function getStartingTimestamps(int $a_ass_id): array
128 {
129 global $DIC;
130
131 $ilDB = $DIC->database();
132 $res = array();
133
134 $set = $ilDB->query("SELECT * FROM exc_idl" .
135 " WHERE ass_id = " . $ilDB->quote($a_ass_id, "integer"));
136 while ($row = $ilDB->fetchAssoc($set)) {
137 $res[] = array("member_id" => $row["member_id"],
138 "is_team" => $row["is_team"],
139 "starting_ts" => $row["starting_ts"]);
140 }
141
142 return $res;
143 }
144}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getStartingTimestamps(int $a_ass_id)
Get starting timestamp data for an assignment.
__construct(int $a_ass_id, int $a_participant_id, bool $a_is_team)
static getInstance(int $a_ass_id, int $a_participant_id, bool $a_is_team=false)
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28
Interface ilDBInterface.
$res
Definition: ltiservices.php:69