ILIAS  release_8 Revision v8.24
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.

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

References $DIC, and read().

+ 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.

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

References $query, and getId().

+ Here is the call graph for this function:

◆ getId()

ilECSCourseAttribute::getId ( )

Get id.

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

51 : int
52 {
53 return $this->id;
54 }

References $id.

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

+ Here is the caller graph for this function:

◆ getMid()

ilECSCourseAttribute::getMid ( )

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

71 : int
72 {
73 return $this->mid;
74 }

References $mid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getName()

ilECSCourseAttribute::getName ( )

Get name.

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

85 : string
86 {
87 return $this->name;
88 }

References $name.

Referenced by save().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSCourseAttribute::getServerId ( )

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

61 : int
62 {
63 return $this->server_id;
64 }

References $server_id.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilECSCourseAttribute::read ( )
protected

read active attributes

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

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

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

Referenced by __construct().

+ 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.

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 }

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

+ 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.

77 : void
78 {
79 $this->name = $a_name;
80 }

Referenced by read().

+ 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: