ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSCourseAttribute Class Reference

Storage of course attributes for assignment rules. More...

+ Collaboration diagram for ilECSCourseAttribute:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 getId ()
 Get id. More...
 
 setServerId ($a_server_id)
 
 getServerId ()
 
 setMid ($a_mid)
 
 getMid ()
 
 setName ($a_name)
 
 getName ()
 Get name. More...
 
 delete ()
 Delete attribute type $ilDB. More...
 
 save ()
 Save a new entry type $ilDB. More...
 

Protected Member Functions

 read ()
 read active attributes More...
 

Private Attributes

 $id = 0
 
 $server_id = 0
 
 $mid = 0
 
 $name = ''
 

Detailed Description

Storage of course attributes for assignment rules.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 10 of file class.ilECSCourseAttribute.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseAttribute::__construct (   $a_id = 0)

Constructor.

Parameters
int$attribute_id

Definition at line 21 of file class.ilECSCourseAttribute.php.

References read().

22  {
23  $this->id = $a_id;
24 
25  $this->read();
26  }
read()
read active attributes
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCourseAttribute::delete ( )

Delete attribute type $ilDB.

Returns
boolean

Definition at line 77 of file class.ilECSCourseAttribute.php.

References $ilDB, $query, and getId().

78  {
79  global $ilDB;
80 
81  $query = "DELETE FROM ecs_crs_mapping_atts " .
82  'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
83  $ilDB->manipulate($query);
84  return true;
85  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getId()

ilECSCourseAttribute::getId ( )

Get id.

Returns
int

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

References $id.

Referenced by delete(), read(), and save().

33  {
34  return $this->id;
35  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseAttribute::getMid ( )

Definition at line 52 of file class.ilECSCourseAttribute.php.

References $mid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getName()

ilECSCourseAttribute::getName ( )

Get name.

Returns
type

Definition at line 67 of file class.ilECSCourseAttribute.php.

References $name.

Referenced by save().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseAttribute::getServerId ( )

Definition at line 42 of file class.ilECSCourseAttribute.php.

References $server_id.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilECSCourseAttribute::read ( )
protected

read active attributes

Definition at line 114 of file class.ilECSCourseAttribute.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getId(), and setName().

Referenced by __construct().

115  {
116  global $ilDB;
117 
118  if (!$this->getId()) {
119  return true;
120  }
121 
122 
123  $query = 'SELECT * FROM ecs_crs_mapping_atts ' .
124  'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
125  $res = $ilDB->query($query);
126  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
127  $this->setName($row->name);
128  }
129  return true;
130  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSCourseAttribute::save ( )

Save a new entry type $ilDB.

Returns
boolean

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

References $ilDB, $query, getId(), getMid(), getName(), and getServerId().

93  {
94  global $ilDB;
95 
96  $this->id = $ilDB->nextId('ecs_crs_mapping_atts');
97 
98  $query = 'INSERT INTO ecs_crs_mapping_atts (id,sid,mid,name) ' .
99  'VALUES ( ' .
100  $ilDB->quote($this->getId(), 'integer') . ', ' .
101  $ilDB->quote($this->getServerId(), 'integer') . ', ' .
102  $ilDB->quote($this->getMid(), 'integer') . ', ' .
103  $ilDB->quote($this->getName(), 'text') . ' ' .
104  ') ';
105  $ilDB->manipulate($query);
106  return true;
107  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ setMid()

ilECSCourseAttribute::setMid (   $a_mid)

Definition at line 47 of file class.ilECSCourseAttribute.php.

48  {
49  $this->mid = $a_mid;
50  }

◆ setName()

ilECSCourseAttribute::setName (   $a_name)

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

Referenced by read().

59  {
60  $this->name = $a_name;
61  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseAttribute::setServerId (   $a_server_id)

Definition at line 37 of file class.ilECSCourseAttribute.php.

38  {
39  $this->server_id = $a_server_id;
40  }

Field Documentation

◆ $id

ilECSCourseAttribute::$id = 0
private

Definition at line 12 of file class.ilECSCourseAttribute.php.

Referenced by getId().

◆ $mid

ilECSCourseAttribute::$mid = 0
private

Definition at line 14 of file class.ilECSCourseAttribute.php.

Referenced by getMid().

◆ $name

ilECSCourseAttribute::$name = ''
private

Definition at line 15 of file class.ilECSCourseAttribute.php.

Referenced by getName().

◆ $server_id

ilECSCourseAttribute::$server_id = 0
private

Definition at line 13 of file class.ilECSCourseAttribute.php.

Referenced by getServerId().


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