19 declare(strict_types=1);
29 public function __construct(
string $authMode,
int $authSourceId = 0)
32 $this->db = $DIC->database();
67 return isset($this->mapping[$offset]);
77 if ($offset ===
null) {
78 $this->mapping[] = $value;
80 $this->mapping[$offset] = $value;
86 unset($this->mapping[$offset]);
91 return count($this->mapping);
99 public function next(): void
101 next($this->mapping);
104 public function key(): string
106 return key($this->mapping);
116 reset($this->mapping);
119 protected function read(): void
123 $res = $this->db->queryF(
124 'SELECT * FROM auth_ext_attr_mapping WHERE auth_mode = %s AND auth_src_id = %s',
128 while ($row = $this->db->fetchAssoc(
$res)) {
130 $rule->setAttribute($row[
'attribute']);
131 $rule->setExternalAttribute($row[
'ext_attribute']);
132 $rule->updateAutomatically((
bool) $row[
'update_automatically']);
134 $this->mapping[$rule->getAttribute()] = $rule;
140 foreach ($this->mapping as $rule) {
142 'auth_ext_attr_mapping',
146 'attribute' => [
'text', $rule->getAttribute()]
149 'ext_attribute' => [
'text', $rule->getExternalAttribute()],
150 'update_automatically' => [
'integer', (
int) $rule->isAutomaticallyUpdated()]
156 public function delete():
void 159 $this->db->manipulateF(
160 'DELETE FROM auth_ext_attr_mapping WHERE auth_mode = %s AND auth_src_id = %s',
offsetSet($offset, $value)
__construct(string $authMode, int $authSourceId=0)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setAuthSourceId(int $authSourceId)
setAuthMode(string $authMode)