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

Class ilAdvancedMDFieldTranslation. More...

+ Collaboration diagram for ilAdvancedMDFieldTranslation:

Public Member Functions

 __construct (int $field_id, string $title, string $description, string $lang_key)
 ilAdvancedMDFieldTranslation constructor. More...
 
 setTitle (string $title)
 
 setDescription (string $description)
 
 getFieldId ()
 
 getTitle ()
 
 getDescription ()
 
 getLangKey ()
 
 update ()
 
 delete ()
 
 insert ()
 

Data Fields

const TABLE_NAME = 'adv_md_field_int'
 

Private Attributes

int $field_id
 
string $title
 
string $description
 
string $lang_key
 
ilDBInterface $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAdvancedMDFieldTranslation::__construct ( int  $field_id,
string  $title,
string  $description,
string  $lang_key 
)

ilAdvancedMDFieldTranslation constructor.

Definition at line 25 of file class.ilAdvancedMDFieldTranslation.php.

References $description, $DIC, $field_id, $lang_key, and $title.

26  {
27  global $DIC;
28 
29  $this->db = $DIC->database();
30 
31  $this->field_id = $field_id;
32  $this->title = $title;
33  $this->description = $description;
34  $this->lang_key = $lang_key;
35  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ delete()

ilAdvancedMDFieldTranslation::delete ( )

Definition at line 87 of file class.ilAdvancedMDFieldTranslation.php.

References $query, getFieldId(), getLangKey(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

87  : void
88  {
89  $query = 'delete from ' . self::TABLE_NAME . ' ' .
90  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' and ' .
91  'lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT);
92  $this->db->manipulate($query);
93  }
$query
+ Here is the call graph for this function:

◆ getDescription()

ilAdvancedMDFieldTranslation::getDescription ( )

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

References $description.

Referenced by insert(), and update().

57  : string
58  {
59  return $this->description;
60  }
+ Here is the caller graph for this function:

◆ getFieldId()

ilAdvancedMDFieldTranslation::getFieldId ( )

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

References $field_id.

Referenced by delete(), insert(), and update().

47  : int
48  {
49  return $this->field_id;
50  }
+ Here is the caller graph for this function:

◆ getLangKey()

ilAdvancedMDFieldTranslation::getLangKey ( )

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

References $lang_key.

Referenced by delete(), insert(), and update().

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

◆ getTitle()

ilAdvancedMDFieldTranslation::getTitle ( )

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

References $title.

Referenced by insert(), and update().

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

◆ insert()

ilAdvancedMDFieldTranslation::insert ( )

Definition at line 95 of file class.ilAdvancedMDFieldTranslation.php.

References $query, getDescription(), getFieldId(), getLangKey(), getTitle(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by update().

95  : void
96  {
97  $query = 'insert into ' . self::TABLE_NAME . ' (field_id, title, lang_code, description) ' .
98  'values ( ' .
99  $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ', ' .
100  $this->db->quote($this->getTitle(), ilDBConstants::T_TEXT) . ', ' .
101  $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT) . ', ' .
102  $this->db->quote($this->getDescription(), ilDBConstants::T_TEXT) . ' ' .
103  ')';
104  $this->db->manipulate($query);
105  }
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

ilAdvancedMDFieldTranslation::setDescription ( string  $description)

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

References $description.

42  : void
43  {
44  $this->description = $description;
45  }

◆ setTitle()

ilAdvancedMDFieldTranslation::setTitle ( string  $title)

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

References $title.

37  : void
38  {
39  $this->title = $title;
40  }

◆ update()

ilAdvancedMDFieldTranslation::update ( )

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

References $query, $res, getDescription(), getFieldId(), getLangKey(), getTitle(), insert(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

67  : void
68  {
69  $query = 'select * from ' . self::TABLE_NAME . ' ' .
70  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' ' .
71  'and lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT) . ' ';
72  $res = $this->db->query($query);
73  if (!$res->numRows()) {
74  $this->insert();
75  return;
76  }
77 
78  $query = 'update ' . self::TABLE_NAME . ' ' .
79  'set title = ' . $this->db->quote($this->getTitle(), ilDBConstants::T_TEXT) . ', ' .
80  'description = ' . $this->db->quote($this->getDescription(), ilDBConstants::T_TEXT) . ' ' .
81  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' ' .
82  'and lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT);
83 
84  $this->db->manipulate($query);
85  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilAdvancedMDFieldTranslation::$db
private

Definition at line 20 of file class.ilAdvancedMDFieldTranslation.php.

◆ $description

string ilAdvancedMDFieldTranslation::$description
private

◆ $field_id

int ilAdvancedMDFieldTranslation::$field_id
private

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

Referenced by __construct(), and getFieldId().

◆ $lang_key

string ilAdvancedMDFieldTranslation::$lang_key
private

Definition at line 18 of file class.ilAdvancedMDFieldTranslation.php.

Referenced by __construct(), and getLangKey().

◆ $title

string ilAdvancedMDFieldTranslation::$title
private

Definition at line 16 of file class.ilAdvancedMDFieldTranslation.php.

Referenced by __construct(), getTitle(), and setTitle().

◆ TABLE_NAME

const ilAdvancedMDFieldTranslation::TABLE_NAME = 'adv_md_field_int'

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


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