ILIAS  release_8 Revision v8.23
ilECSDataMappingSetting Class Reference
+ Collaboration diagram for ilECSDataMappingSetting:

Public Member Functions

 __construct (int $a_server_id=0, int $mapping_type=0, string $ecs_field='')
 
 setServerId (int $a_server_id)
 set server id More...
 
 getServerId ()
 Get server id. More...
 
 setECSField (string $ecs_field)
 
 getECSField ()
 Get ecs field. More...
 
 setMappingType (int $mapping_type)
 Set mapping type. More...
 
 getMappingType ()
 Get mapping type. More...
 
 getAdvMDId ()
 
 setAdvMDId (int $a_id)
 
 save ()
 Save mappings. More...
 

Data Fields

const MAPPING_EXPORT = 1
 
const MAPPING_IMPORT_CRS = 2
 
const MAPPING_IMPORT_RCRS = 3
 

Protected Member Functions

 update ()
 Update setting. More...
 
 create ()
 

Private Member Functions

 read ()
 Read settings. More...
 

Private Attributes

ilDBInterface $db
 
int $server_id = 0
 
int $mapping_type = 0
 
string $ecs_field = ''
 
int $advmd_id = 0
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 23 of file class.ilECSDataMappingSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSDataMappingSetting::__construct ( int  $a_server_id = 0,
int  $mapping_type = 0,
string  $ecs_field = '' 
)

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

References $DIC, setECSField(), setMappingType(), and setServerId().

37  {
38  global $DIC;
39 
40  $this->db = $DIC->database();
41 
42  $this->setServerId($a_server_id);
44  $this->setECSField($ecs_field);
45  }
global $DIC
Definition: feed.php:28
setServerId(int $a_server_id)
set server id
setMappingType(int $mapping_type)
Set mapping type.
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSDataMappingSetting::create ( )
protected

Definition at line 132 of file class.ilECSDataMappingSetting.php.

References $query, getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

132  : bool
133  {
134  $query = 'INSERT INTO ecs_data_mapping (sid,mapping_type,ecs_field,advmd_id) ' .
135  'VALUES(' .
136  $this->db->quote($this->getServerId(), 'integer') . ', ' .
137  $this->db->quote($this->getMappingType(), 'integer') . ', ' .
138  $this->db->quote($this->getECSField(), 'text') . ', ' .
139  $this->db->quote($this->getAdvMDId(), 'integer') . ' ) ';
140  $this->db->manipulate($query);
141  return true;
142  }
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdvMDId()

ilECSDataMappingSetting::getAdvMDId ( )

Definition at line 92 of file class.ilECSDataMappingSetting.php.

References $advmd_id.

Referenced by create(), and update().

92  : int
93  {
94  return $this->advmd_id;
95  }
+ Here is the caller graph for this function:

◆ getECSField()

ilECSDataMappingSetting::getECSField ( )

Get ecs field.

Definition at line 71 of file class.ilECSDataMappingSetting.php.

References $ecs_field.

Referenced by create(), read(), save(), and update().

71  : string
72  {
73  return $this->ecs_field;
74  }
+ Here is the caller graph for this function:

◆ getMappingType()

ilECSDataMappingSetting::getMappingType ( )

Get mapping type.

Definition at line 87 of file class.ilECSDataMappingSetting.php.

References $mapping_type.

Referenced by create(), read(), save(), and update().

87  : int
88  {
89  return $this->mapping_type;
90  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSDataMappingSetting::getServerId ( )

Get server id.

Definition at line 58 of file class.ilECSDataMappingSetting.php.

References $server_id.

Referenced by create(), read(), save(), and update().

58  : int
59  {
60  return $this->server_id;
61  }
+ Here is the caller graph for this function:

◆ read()

ilECSDataMappingSetting::read ( )
private

Read settings.

Definition at line 148 of file class.ilECSDataMappingSetting.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, getECSField(), getMappingType(), getServerId(), and setAdvMDId().

148  : void
149  {
150  if ($this->getServerId() || $this->getMappingType() || $this->getECSField()) {
151  $query = 'SELECT * FROM ecs_data_mapping ' .
152  'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
153  'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
154  'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
155  $res = $this->db->query($query);
156  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
157  $this->setAdvMDId($row->advmd_id);
158  }
159  }
160  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ save()

ilECSDataMappingSetting::save ( )

Save mappings.

Definition at line 105 of file class.ilECSDataMappingSetting.php.

References $query, $res, create(), getECSField(), getMappingType(), getServerId(), and update().

105  : void
106  {
107  $query = 'SELECT * FROM ecs_data_mapping ' .
108  'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
109  'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
110  'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
111  $res = $this->db->query($query);
112  if ($res->numRows()) {
113  $this->update();
114  } else {
115  $this->create();
116  }
117  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

◆ setAdvMDId()

ilECSDataMappingSetting::setAdvMDId ( int  $a_id)

Definition at line 97 of file class.ilECSDataMappingSetting.php.

Referenced by read().

97  : void
98  {
99  $this->advmd_id = $a_id;
100  }
+ Here is the caller graph for this function:

◆ setECSField()

ilECSDataMappingSetting::setECSField ( string  $ecs_field)

Definition at line 63 of file class.ilECSDataMappingSetting.php.

References $ecs_field.

Referenced by __construct().

63  : void
64  {
65  $this->ecs_field = $ecs_field;
66  }
+ Here is the caller graph for this function:

◆ setMappingType()

ilECSDataMappingSetting::setMappingType ( int  $mapping_type)

Set mapping type.

Definition at line 79 of file class.ilECSDataMappingSetting.php.

References $mapping_type.

Referenced by __construct().

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

◆ setServerId()

ilECSDataMappingSetting::setServerId ( int  $a_server_id)

set server id

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

Referenced by __construct().

50  : void
51  {
52  $this->server_id = $a_server_id;
53  }
+ Here is the caller graph for this function:

◆ update()

ilECSDataMappingSetting::update ( )
protected

Update setting.

Definition at line 122 of file class.ilECSDataMappingSetting.php.

References $query, getAdvMDId(), getECSField(), getMappingType(), and getServerId().

Referenced by save().

122  : void
123  {
124  $query = 'UPDATE ecs_data_mapping ' .
125  'SET advmd_id = ' . $this->db->quote($this->getAdvMDId(), 'integer') . ' ' .
126  'WHERE sid = ' . $this->db->quote($this->getServerId(), 'integer') . ' ' .
127  'AND mapping_type = ' . $this->db->quote($this->getMappingType(), 'integer') . ' ' .
128  'AND ecs_field = ' . $this->db->quote($this->getECSField(), 'text');
129  $this->db->manipulate($query);
130  }
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $advmd_id

int ilECSDataMappingSetting::$advmd_id = 0
private

Definition at line 34 of file class.ilECSDataMappingSetting.php.

Referenced by getAdvMDId().

◆ $db

ilDBInterface ilECSDataMappingSetting::$db
private

Definition at line 29 of file class.ilECSDataMappingSetting.php.

◆ $ecs_field

string ilECSDataMappingSetting::$ecs_field = ''
private

Definition at line 33 of file class.ilECSDataMappingSetting.php.

Referenced by getECSField(), and setECSField().

◆ $mapping_type

int ilECSDataMappingSetting::$mapping_type = 0
private

Definition at line 32 of file class.ilECSDataMappingSetting.php.

Referenced by getMappingType(), and setMappingType().

◆ $server_id

int ilECSDataMappingSetting::$server_id = 0
private

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

Referenced by getServerId().

◆ MAPPING_EXPORT

const ilECSDataMappingSetting::MAPPING_EXPORT = 1

◆ MAPPING_IMPORT_CRS

const ilECSDataMappingSetting::MAPPING_IMPORT_CRS = 2

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

Referenced by ilECSSettingsGUI\initMappingsForm().

◆ MAPPING_IMPORT_RCRS


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