ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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

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

Member Function Documentation

◆ delete()

ilAdvancedMDFieldTranslation::delete ( )

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

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 }

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

+ Here is the call graph for this function:

◆ getDescription()

ilAdvancedMDFieldTranslation::getDescription ( )

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

71 : string
72 {
73 return $this->description;
74 }

References $description.

Referenced by insert(), and update().

+ Here is the caller graph for this function:

◆ getFieldId()

ilAdvancedMDFieldTranslation::getFieldId ( )

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

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

References $field_id.

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

+ Here is the caller graph for this function:

◆ getLangKey()

ilAdvancedMDFieldTranslation::getLangKey ( )

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

76 : string
77 {
78 return $this->lang_key;
79 }

References $lang_key.

Referenced by insert(), and update().

+ Here is the caller graph for this function:

◆ getTitle()

ilAdvancedMDFieldTranslation::getTitle ( )

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

66 : string
67 {
68 return $this->title;
69 }

References $title.

Referenced by insert(), and update().

+ Here is the caller graph for this function:

◆ insert()

ilAdvancedMDFieldTranslation::insert ( )

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

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 }

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

Referenced by update().

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

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

References $description.

◆ setTitle()

ilAdvancedMDFieldTranslation::setTitle ( string  $title)

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

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

References $title.

◆ update()

ilAdvancedMDFieldTranslation::update ( )

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

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

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

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