ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 26 of file class.ilECSCourseAttribute.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSCourseAttribute::__construct ( int  $a_id = 0)

Constructor.

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

References $DIC, and read().

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

Member Function Documentation

◆ delete()

ilECSCourseAttribute::delete ( )

Delete attribute.

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

References getId().

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

◆ getId()

ilECSCourseAttribute::getId ( )

Get id.

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

References $id.

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

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

◆ getMid()

ilECSCourseAttribute::getMid ( )

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

References $mid.

Referenced by save().

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

◆ getName()

ilECSCourseAttribute::getName ( )

Get name.

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

References $name.

Referenced by save().

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

◆ getServerId()

ilECSCourseAttribute::getServerId ( )

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

References $server_id.

Referenced by save().

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

◆ read()

ilECSCourseAttribute::read ( )
protected

read active attributes

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

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

Referenced by __construct().

125  : bool
126  {
127  if (!$this->getId()) {
128  return true;
129  }
130  $query = 'SELECT * FROM ecs_crs_mapping_atts ' .
131  'WHERE id = ' . $this->db->quote($this->getId(), 'integer');
132  $res = $this->db->query($query);
133  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
134  $this->setName($row->name);
135  }
136  return true;
137  }
$res
Definition: ltiservices.php:66
+ 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 105 of file class.ilECSCourseAttribute.php.

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

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

◆ setMid()

ilECSCourseAttribute::setMid ( int  $a_mid)

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

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

◆ setName()

ilECSCourseAttribute::setName ( string  $a_name)

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

Referenced by read().

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

◆ setServerId()

ilECSCourseAttribute::setServerId ( int  $a_server_id)

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

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

Field Documentation

◆ $db

ilDBInterface ilECSCourseAttribute::$db
private

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

◆ $id

int ilECSCourseAttribute::$id
private

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

Referenced by getId().

◆ $mid

int ilECSCourseAttribute::$mid = 0
private

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

Referenced by getMid().

◆ $name

string ilECSCourseAttribute::$name = ''
private

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

Referenced by getName().

◆ $server_id

int ilECSCourseAttribute::$server_id = 0
private

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

Referenced by getServerId().


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