ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSCourseAttribute Class Reference

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

+ Collaboration diagram for ilECSCourseAttribute:

Public Member Functions

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

Protected Member Functions

 read ()
 read active attributes More...
 

Private Attributes

int $id
 
int $server_id = 0
 
int $mid = 0
 
string $name = ''
 
ilDBInterface $db
 

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 25 of file class.ilECSCourseAttribute.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseAttribute::__construct ( int  $a_id = 0)

Constructor.

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

References $DIC, and read().

38  {
39  global $DIC;
40 
41  $this->db = $DIC->database();
42 
43  $this->id = $a_id;
44 
45  $this->read();
46  }
read()
read active attributes
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCourseAttribute::delete ( )

Delete attribute.

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

References $query, and getId().

93  : bool
94  {
95  $query = "DELETE FROM ecs_crs_mapping_atts " .
96  'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
97  $this->db->manipulate($query);
98  return true;
99  }
$query
+ Here is the call graph for this function:

◆ getId()

ilECSCourseAttribute::getId ( )

Get id.

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

References $id.

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

51  : int
52  {
53  return $this->id;
54  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseAttribute::getMid ( )

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

References $mid.

Referenced by save().

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

◆ getName()

ilECSCourseAttribute::getName ( )

Get name.

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

References $name.

Referenced by save().

85  : string
86  {
87  return $this->name;
88  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseAttribute::getServerId ( )

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

References $server_id.

Referenced by save().

61  : int
62  {
63  return $this->server_id;
64  }
+ Here is the caller graph for this function:

◆ read()

ilECSCourseAttribute::read ( )
protected

read active attributes

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

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

Referenced by __construct().

124  : bool
125  {
126  if (!$this->getId()) {
127  return true;
128  }
129  $query = 'SELECT * FROM ecs_crs_mapping_atts ' .
130  'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
131  $res = $this->db->query($query);
132  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
133  $this->setName($row->name);
134  }
135  return true;
136  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSCourseAttribute::save ( )

Save a new entry.

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

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

104  : bool
105  {
106  $this->id = $this->db->nextId('ecs_crs_mapping_atts');
107 
108  $query = 'INSERT INTO ecs_crs_mapping_atts (id,sid,mid,name) ' .
109  'VALUES ( ' .
110  $this->db->quote($this->getId(), 'integer') . ', ' .
111  $this->db->quote($this->getServerId(), 'integer') . ', ' .
112  $this->db->quote($this->getMid(), 'integer') . ', ' .
113  $this->db->quote($this->getName(), 'text') . ' ' .
114  ') ';
115  $this->db->manipulate($query);
116  return true;
117  }
$query
+ Here is the call graph for this function:

◆ setMid()

ilECSCourseAttribute::setMid ( int  $a_mid)

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

66  : void
67  {
68  $this->mid = $a_mid;
69  }

◆ setName()

ilECSCourseAttribute::setName ( string  $a_name)

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

Referenced by read().

77  : void
78  {
79  $this->name = $a_name;
80  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSCourseAttribute::setServerId ( int  $a_server_id)

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

56  : void
57  {
58  $this->server_id = $a_server_id;
59  }

Field Documentation

◆ $db

ilDBInterface ilECSCourseAttribute::$db
private

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

◆ $id

int ilECSCourseAttribute::$id
private

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

Referenced by getId().

◆ $mid

int ilECSCourseAttribute::$mid = 0
private

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

Referenced by getMid().

◆ $name

string ilECSCourseAttribute::$name = ''
private

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

Referenced by getName().

◆ $server_id

int ilECSCourseAttribute::$server_id = 0
private

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

Referenced by getServerId().


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