ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 39 of file class.ilAdvancedMDFieldTranslation.php.

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

40  {
41  global $DIC;
42 
43  $this->db = $DIC->database();
44 
45  $this->field_id = $field_id;
46  $this->title = $title;
47  $this->description = $description;
48  $this->lang_key = $lang_key;
49  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ delete()

ilAdvancedMDFieldTranslation::delete ( )

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

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

101  : void
102  {
103  $query = 'delete from ' . self::TABLE_NAME . ' ' .
104  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' and ' .
105  'lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT);
106  $this->db->manipulate($query);
107  }
+ Here is the call graph for this function:

◆ getDescription()

ilAdvancedMDFieldTranslation::getDescription ( )

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

References $description.

Referenced by insert(), and update().

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

◆ getFieldId()

ilAdvancedMDFieldTranslation::getFieldId ( )

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

References $field_id.

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

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

◆ getLangKey()

ilAdvancedMDFieldTranslation::getLangKey ( )

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

References $lang_key.

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

76  : string
77  {
78  return $this->lang_key;
79  }
+ Here is the caller graph for this function:

◆ getTitle()

ilAdvancedMDFieldTranslation::getTitle ( )

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

References $title.

Referenced by insert(), and update().

66  : string
67  {
68  return $this->title;
69  }
+ Here is the caller graph for this function:

◆ insert()

ilAdvancedMDFieldTranslation::insert ( )

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

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

Referenced by update().

109  : void
110  {
111  $query = 'insert into ' . self::TABLE_NAME . ' (field_id, title, lang_code, description) ' .
112  'values ( ' .
113  $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ', ' .
114  $this->db->quote($this->getTitle(), ilDBConstants::T_TEXT) . ', ' .
115  $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT) . ', ' .
116  $this->db->quote($this->getDescription(), ilDBConstants::T_TEXT) . ' ' .
117  ')';
118  $this->db->manipulate($query);
119  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

ilAdvancedMDFieldTranslation::setDescription ( string  $description)

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

References $description.

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

◆ setTitle()

ilAdvancedMDFieldTranslation::setTitle ( string  $title)

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

References $title.

51  : void
52  {
53  $this->title = $title;
54  }

◆ update()

ilAdvancedMDFieldTranslation::update ( )

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

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

81  : void
82  {
83  $query = 'select * from ' . self::TABLE_NAME . ' ' .
84  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' ' .
85  'and lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT) . ' ';
86  $res = $this->db->query($query);
87  if (!$res->numRows()) {
88  $this->insert();
89  return;
90  }
91 
92  $query = 'update ' . self::TABLE_NAME . ' ' .
93  'set title = ' . $this->db->quote($this->getTitle(), ilDBConstants::T_TEXT) . ', ' .
94  'description = ' . $this->db->quote($this->getDescription(), ilDBConstants::T_TEXT) . ' ' .
95  'where field_id = ' . $this->db->quote($this->getFieldId(), ilDBConstants::T_INTEGER) . ' ' .
96  'and lang_code = ' . $this->db->quote($this->getLangKey(), ilDBConstants::T_TEXT);
97 
98  $this->db->manipulate($query);
99  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilAdvancedMDFieldTranslation::$db
private

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

◆ $description

string ilAdvancedMDFieldTranslation::$description
private

◆ $field_id

int ilAdvancedMDFieldTranslation::$field_id
private

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

Referenced by __construct(), and getFieldId().

◆ $lang_key

string ilAdvancedMDFieldTranslation::$lang_key
private

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

Referenced by __construct(), and getLangKey().

◆ $title

string ilAdvancedMDFieldTranslation::$title
private

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

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

◆ TABLE_NAME

const ilAdvancedMDFieldTranslation::TABLE_NAME = 'adv_md_field_int'

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


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