ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExcIndividualDeadline Class Reference

Individual deadlines. More...

+ Collaboration diagram for ilExcIndividualDeadline:

Public Member Functions

 setStartingTimestamp ($a_val)
 Set starting timestamp. More...
 
 getStartingTimestamp ()
 Get starting timestamp. More...
 
 setIndividualDeadline ($a_val)
 Set Individual Deadline. More...
 
 getIndividualDeadline ()
 Get Individual Deadline. More...
 
 read ()
 Read. More...
 
 save ()
 Save. More...
 
 delete ()
 Delete. More...
 

Static Public Member Functions

static getInstance ($a_ass_id, $a_participant_id, $a_is_team=false)
 Get instance. More...
 
static getStartingTimestamps ($a_ass_id)
 Get starting timestamp data for an assignment. More...
 

Protected Member Functions

 __construct ($a_ass_id, $a_participant_id, $a_is_team)
 ilExcIndividualDeadline constructor. More...
 

Protected Attributes

 $participant_id
 
 $is_team
 
 $ass_id
 
 $db
 
 $starting_timestamp = 0
 
 $individual_deadline
 

Detailed Description

Individual deadlines.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilExcIndividualDeadline.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcIndividualDeadline::__construct (   $a_ass_id,
  $a_participant_id,
  $a_is_team 
)
protected

ilExcIndividualDeadline constructor.

Parameters
int$a_ass_id
int$a_participant_id
bool$a_is_team

Definition at line 50 of file class.ilExcIndividualDeadline.php.

References $DIC, and read().

51  {
52  global $DIC;
53  $this->participant_id = $a_participant_id;
54  $this->is_team = $a_is_team;
55  $this->ass_id = $a_ass_id;
56  $this->db = $DIC->database();
57  $this->read();
58  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilExcIndividualDeadline::delete ( )

Delete.

Definition at line 156 of file class.ilExcIndividualDeadline.php.

References $db, and $ilDB.

157  {
158  $ilDB = $this->db;
159 
160  $ilDB->manipulate(
161  "DELETE FROM exc_idl " .
162  " WHERE ass_id = " . $this->db->quote($this->ass_id, "integer") .
163  " AND member_id = " . $this->db->quote($this->participant_id, "integer") .
164  " AND is_team = " . $this->db->quote($this->is_team, "integer")
165  );
166  }
global $ilDB

◆ getIndividualDeadline()

ilExcIndividualDeadline::getIndividualDeadline ( )

Get Individual Deadline.

Returns
int

Definition at line 108 of file class.ilExcIndividualDeadline.php.

References $individual_deadline.

Referenced by save().

+ Here is the caller graph for this function:

◆ getInstance()

static ilExcIndividualDeadline::getInstance (   $a_ass_id,
  $a_participant_id,
  $a_is_team = false 
)
static

Get instance.

Parameters
int$a_ass_id
int$a_participant_id
bool$a_is_team
Returns
ilExcIndividualDeadline

Definition at line 68 of file class.ilExcIndividualDeadline.php.

Referenced by ilExAssignmentTeam\adoptTeams(), ilExcAssMemberState\getInstanceByIds(), ilExAssignmentTeam\getTeamId(), and ilExAssignment\setIndividualDeadline().

69  {
70  return new self($a_ass_id, $a_participant_id, $a_is_team);
71  }
+ Here is the caller graph for this function:

◆ getStartingTimestamp()

ilExcIndividualDeadline::getStartingTimestamp ( )

Get starting timestamp.

Returns
int starting timestamp

Definition at line 88 of file class.ilExcIndividualDeadline.php.

References $starting_timestamp.

Referenced by save().

+ Here is the caller graph for this function:

◆ getStartingTimestamps()

static ilExcIndividualDeadline::getStartingTimestamps (   $a_ass_id)
static

Get starting timestamp data for an assignment.

This is mainly used by ilExAssignment to determine the calculated deadlines

Parameters
$a_ass_id
Returns
array

Definition at line 177 of file class.ilExcIndividualDeadline.php.

References $DIC, $ilDB, $res, and $row.

Referenced by ilExAssignment\getCalculatedDeadlines().

178  {
179  global $DIC;
180 
181  $ilDB = $DIC->database();
182  $res = array();
183 
184  $set = $ilDB->query("SELECT * FROM exc_idl" .
185  " WHERE ass_id = " . $ilDB->quote($a_ass_id, "integer"));
186  while ($row = $ilDB->fetchAssoc($set)) {
187  $res[] = array("member_id" => $row["member_id"],
188  "is_team" => $row["is_team"],
189  "starting_ts" => $row["starting_ts"]);
190  }
191 
192  return $res;
193  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilExcIndividualDeadline::read ( )

Read.

Definition at line 116 of file class.ilExcIndividualDeadline.php.

References $db, $ilDB, setIndividualDeadline(), and setStartingTimestamp().

Referenced by __construct().

117  {
118  $ilDB = $this->db;
119 
120  $set = $ilDB->query(
121  "SELECT * FROM exc_idl " .
122  " WHERE ass_id = " . $this->db->quote($this->ass_id, "integer") .
123  " AND member_id = " . $this->db->quote($this->participant_id, "integer") .
124  " AND is_team = " . $this->db->quote($this->is_team, "integer")
125  );
126  $rec = $this->db->fetchAssoc($set);
127 
128  $this->setIndividualDeadline((int) $rec["tstamp"]);
129  $this->setStartingTimestamp((int) $rec["starting_ts"]);
130  }
setStartingTimestamp($a_val)
Set starting timestamp.
setIndividualDeadline($a_val)
Set Individual Deadline.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilExcIndividualDeadline::save ( )

Save.

Definition at line 135 of file class.ilExcIndividualDeadline.php.

References $db, $ilDB, getIndividualDeadline(), and getStartingTimestamp().

136  {
137  $ilDB = $this->db;
138 
139  $ilDB->replace(
140  "exc_idl",
141  array(
142  "ass_id" => array("integer", $this->ass_id),
143  "member_id" => array("integer", $this->participant_id),
144  "is_team" => array("integer", $this->is_team)
145  ),
146  array(
147  "tstamp" => array("integer", $this->getIndividualDeadline()),
148  "starting_ts" => array("integer", $this->getStartingTimestamp())
149  )
150  );
151  }
getStartingTimestamp()
Get starting timestamp.
getIndividualDeadline()
Get Individual Deadline.
global $ilDB
+ Here is the call graph for this function:

◆ setIndividualDeadline()

ilExcIndividualDeadline::setIndividualDeadline (   $a_val)

Set Individual Deadline.

Parameters
int$a_val

Definition at line 98 of file class.ilExcIndividualDeadline.php.

Referenced by read().

99  {
100  $this->individual_deadline = $a_val;
101  }
+ Here is the caller graph for this function:

◆ setStartingTimestamp()

ilExcIndividualDeadline::setStartingTimestamp (   $a_val)

Set starting timestamp.

Parameters
int$a_valstarting timestamp

Definition at line 78 of file class.ilExcIndividualDeadline.php.

Referenced by read().

79  {
80  $this->starting_timestamp = $a_val;
81  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ass_id

ilExcIndividualDeadline::$ass_id
protected

Definition at line 26 of file class.ilExcIndividualDeadline.php.

◆ $db

ilExcIndividualDeadline::$db
protected

Definition at line 31 of file class.ilExcIndividualDeadline.php.

Referenced by delete(), read(), and save().

◆ $individual_deadline

ilExcIndividualDeadline::$individual_deadline
protected

Definition at line 41 of file class.ilExcIndividualDeadline.php.

Referenced by getIndividualDeadline().

◆ $is_team

ilExcIndividualDeadline::$is_team
protected

Definition at line 21 of file class.ilExcIndividualDeadline.php.

◆ $participant_id

ilExcIndividualDeadline::$participant_id
protected

Definition at line 16 of file class.ilExcIndividualDeadline.php.

◆ $starting_timestamp

ilExcIndividualDeadline::$starting_timestamp = 0
protected

Definition at line 36 of file class.ilExcIndividualDeadline.php.

Referenced by getStartingTimestamp().


The documentation for this class was generated from the following file: