19 declare(strict_types=1);
32 protected \ilDBInterface
$db;
44 $id = $this->db->nextId(
"il_exc_team");
45 $this->db->insert(
"exc_team_data", [
46 "id" => [
"integer",
$id]
51 public function addUser(
int $team_id,
int $ass_id,
int $user_id): void
53 $this->db->insert(
"il_exc_team", [
54 "id" => [
"integer", $team_id],
55 "ass_id" => [
"integer", $ass_id],
56 "user_id" => [
"integer", $user_id]
60 public function removeUser(
int $team_id,
int $ass_id,
int $user_id): void
62 $this->db->manipulateF(
63 "DELETE FROM il_exc_team WHERE " .
64 " id = %s AND ass_id = %s AND user_id = %s",
65 [
"integer",
"integer",
"integer"],
79 $set = $this->db->queryF(
80 "SELECT * FROM il_exc_team " .
85 while ($rec = $this->db->fetchAssoc($set)) {
86 yield $this->data->teamMember(
96 $set = $this->db->queryF(
97 "SELECT id FROM il_exc_team " .
98 " WHERE ass_id = %s AND user_id = %s",
99 [
"integer",
"integer"],
102 $rec = $this->db->fetchAssoc($set);
103 if (isset($rec[
"id"])) {
104 return (
int) $rec[
"id"];
111 $set = $this->db->queryF(
112 "SELECT DISTINCT user_id FROM il_exc_team " .
113 " WHERE ass_id = %s ",
117 while ($rec = $this->db->fetchAssoc($set)) {
118 yield (
int) $rec[
"user_id"];
125 $set = $this->db->queryF(
126 "SELECT * FROM il_exc_team " .
127 " WHERE ass_id = %s ",
131 while ($rec = $this->db->fetchAssoc($set)) {
132 $map[(
int) $rec[
"user_id"]] = (
int) $rec[
"id"];
139 $set = $this->db->queryF(
140 "SELECT ass_id FROM il_exc_team " .
145 $rec = $this->db->fetchAssoc($set);
146 return (
int) ($rec[
"ass_id"] ?? 0);
151 $set = $this->db->queryF(
152 "SELECT DISTINCT(id) FROM il_exc_team " .
153 " WHERE ass_id = %s ",
158 while ($rec = $this->db->fetchAssoc($set)) {
159 $team_ids[] = (
int) $rec[
"id"];
166 $this->db->manipulateF(
167 "DELETE FROM il_exc_team WHERE " .
174 $this->db->manipulateF(
175 "DELETE FROM exc_team_data WHERE " .
186 $this->db->manipulateF(
187 "DELETE FROM il_exc_team_log WHERE " .
removeUser(int $team_id, int $ass_id, int $user_id)
InternalDataService $data
getAssignmentForTeam(int $team_id)
Internal factory for data objects.
Table exc_team_data: Team Table il_exc_team: Team participants (holds the sequence due to historic re...
getTeamIdsOfAssignment(int $ass_id)
getUserTeamMap(int $assignment_id)
getTeamForMember(int $ass_id, int $user_id)
deleteTeamLog(int $team_id)
__construct(\ilDBInterface $db, InternalDataService $data)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getAllMemberIdsOfAssignment(int $assignment_id)
addUser(int $team_id, int $ass_id, int $user_id)