19 declare(strict_types=0);
39 $this->db = $DIC->database();
46 $this->assignment_id = $a_id;
56 $this->container_id = $a_id;
66 $this->assignment_type = $a_type;
76 $this->objective_id = $a_id;
86 $this->test_ref_id = $a_id;
94 public function save(): void
106 $query =
'INSERT INTO loc_tst_assignments (assignment_id, container_id, assignment_type, objective_id, tst_ref_id) ' .
112 $this->db->quote($this->
getTestRefId(),
'integer') .
' ' .
114 $this->db->manipulate($query);
119 $query =
'UPDATE loc_tst_assignments ' .
120 'SET container_id = ' . $this->db->quote($this->
getContainerId(),
'integer') .
', ' .
121 'assignment_type = ' . $this->db->quote($this->
getAssignmentType(),
'integer') .
', ' .
122 'objective_id = ' . $this->db->quote($this->
getObjectiveId(),
'integer') .
', ' .
123 'tst_ref_id = ' . $this->db->quote($this->
getTestRefId(),
'integer') .
' ' .
124 'WHERE assignment_id = ' . $this->db->quote($this->
getAssignmentId(),
'integer');
125 $this->db->manipulate($query);
128 public function delete():
void 130 $query =
'DELETE FROM loc_tst_assignments ' .
131 'WHERE assignment_id = ' . $this->db->quote($this->
getAssignmentId(),
'integer') .
' ';
132 $this->db->manipulate($query);
141 $query =
'SELECT * FROM loc_tst_assignments ' .
142 'WHERE assignment_id = ' . $this->db->quote($this->
getAssignmentId(),
'integer') .
' ';
143 $res = $this->db->query($query);
152 public function cloneSettings(
int $a_copy_id,
int $a_target_id,
int $a_objective_id): void
155 $mappings = $options->getMappings();
157 if (!array_key_exists($this->
getTestRefId(), $mappings)) {
162 $copy->setContainerId($a_target_id);
164 $copy->setObjectiveId($a_objective_id);
cloneSettings(int $a_copy_id, int $a_target_id, int $a_objective_id)
setAssignmentType(int $a_type)
setContainerId(int $a_id)
setObjectiveId(int $a_id)
static _getInstance(int $a_copy_id)
setAssignmentId(int $a_id)