ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilOrgUnitUserAssignment.php
Go to the documentation of this file.
1<?php
2
9{
10
14 public static function returnDbTableName()
15 {
16 return 'il_orgu_ua';
17 }
18
19
30 protected $id = 0;
38 protected $user_id = 0;
46 protected $position_id = 0;
54 protected $orgu_id = 0;
55
56
65 {
66 $inst = self::where(array(
67 'user_id' => $user_id,
68 'position_id' => $position_id,
69 'orgu_id' => $orgu_id,
70 ))->first();
71 if (!$inst) {
72 $inst = new self();
73 $inst->setPositionId($position_id);
74 $inst->setUserId($user_id);
75 $inst->setOrguId($orgu_id);
76 $inst->create();
77 }
78
79 return $inst;
80 }
81
82
86 public function getId()
87 {
88 return $this->id;
89 }
90
91
95 public function setId($id)
96 {
97 $this->id = $id;
98 }
99
100
104 public function getUserId()
105 {
106 return $this->user_id;
107 }
108
109
113 public function setUserId($user_id)
114 {
115 $this->user_id = $user_id;
116 }
117
118
122 public function getPositionId()
123 {
124 return $this->position_id;
125 }
126
127
132 {
133 $this->position_id = $position_id;
134 }
135
136
140 public function getOrguId()
141 {
142 return $this->orgu_id;
143 }
144
145
149 public function setOrguId($orgu_id)
150 {
151 $this->orgu_id = $orgu_id;
152 }
153}
Class ActiveRecord.
static where($where, $operator=null)
An exception for terminatinating execution or to throw for unit testing.
Class ilOrgUnitUserAssignment.
static findOrCreateAssignment($user_id, $position_id, $orgu_id)