ILIAS  release_7 Revision v7.30-3-g800a261c036
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 @global type $ilDB. More...
 
 save ()
 Save a new entry @global 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.

22 {
23 $this->id = $a_id;
24
25 $this->read();
26 }
read()
read active attributes

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilECSCourseAttribute::delete ( )

Delete attribute @global type $ilDB.

Returns
boolean

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

78 {
79 global $DIC;
80
81 $ilDB = $DIC['ilDB'];
82
83 $query = "DELETE FROM ecs_crs_mapping_atts " .
84 'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
85 $ilDB->manipulate($query);
86 return true;
87 }
global $DIC
Definition: goto.php:24
$query
global $ilDB

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

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

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

119 {
120 global $DIC;
121
122 $ilDB = $DIC['ilDB'];
123
124 if (!$this->getId()) {
125 return true;
126 }
127
128
129 $query = 'SELECT * FROM ecs_crs_mapping_atts ' .
130 'WHERE id = ' . $ilDB->quote($this->getId(), 'integer');
131 $res = $ilDB->query($query);
132 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
133 $this->setName($row->name);
134 }
135 return true;
136 }
foreach($_POST as $key=> $value) $res

References $DIC, $ilDB, $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 @global type $ilDB.

Returns
boolean

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

95 {
96 global $DIC;
97
98 $ilDB = $DIC['ilDB'];
99
100 $this->id = $ilDB->nextId('ecs_crs_mapping_atts');
101
102 $query = 'INSERT INTO ecs_crs_mapping_atts (id,sid,mid,name) ' .
103 'VALUES ( ' .
104 $ilDB->quote($this->getId(), 'integer') . ', ' .
105 $ilDB->quote($this->getServerId(), 'integer') . ', ' .
106 $ilDB->quote($this->getMid(), 'integer') . ', ' .
107 $ilDB->quote($this->getName(), 'text') . ' ' .
108 ') ';
109 $ilDB->manipulate($query);
110 return true;
111 }

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

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

59 {
60 $this->name = $a_name;
61 }

Referenced by read().

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