CMS  Version 3.9
ToolHint Class Reference

Inherits DataItem.

Public Member Functions

 isHidden ()
 
 setHidden ($hidden=true)
 

Static Public Member Functions

static findToolHint ($code)
 

Public Attributes

 $table = "tool_hint"
 
 $primary_key = "hint_id"
 
 $fields
 

Detailed Description

Definition at line 39 of file tool_hint.inc.

Member Function Documentation

◆ findToolHint()

static ToolHint::findToolHint (   $code)
static

Definition at line 51 of file tool_hint.inc.

52  {
53  return Query::create(ToolHint, "WHERE code=:c")
54  ->bind(":c", $code)
55  ->executeSingle();
56  }
$code
Definition: hide_hint.inc:36

◆ isHidden()

ToolHint::isHidden ( )

Definition at line 58 of file tool_hint.inc.

59  {
60  global $user;
61 
62  try
63  {
64  $status = Query::create(ToolHintUserStatus, "WHERE hint_id=:h AND user_id=:u")
65  ->bind(":h", $this->hint_id, ":u", $user->get($user->getPrimaryKey()))
66  ->executeSingle();
67 
68  return $status->hidden;
69  }
70  catch(DataNotFoundException $e)
71  {
72  return false;
73  }
74  }
global $user

◆ setHidden()

ToolHint::setHidden (   $hidden = true)

Definition at line 76 of file tool_hint.inc.

77  {
78  global $user;
79  $status = null;
80 
81  try
82  {
83  $status = Query::create(ToolHintUserStatus, "WHERE hint_id=:h AND user_id=:u")
84  ->bind(":h", $this->hint_id, ":u", $user->get($user->getPrimaryKey()))
85  ->executeSingle();
86  }
87  catch(DataNotFoundException $e)
88  {
89  $status = new ToolHintUserStatus();
90  $status->hint_id = $this->hint_id;
91  $status->user_id = $user->get($user->getPrimaryKey());
92  }
93 
94  $status->hidden = $hidden;
95  $status->save();
96  }
$hint_id

Member Data Documentation

◆ $fields

ToolHint::$fields
Initial value:
= array("hint_id" => Number,
"code" => String,
"title" => String,
"hint" => HTML,
"can_be_hidden" => Boolean,
"read_access" => String)

Definition at line 44 of file tool_hint.inc.

◆ $primary_key

ToolHint::$primary_key = "hint_id"

Definition at line 42 of file tool_hint.inc.

◆ $table

ToolHint::$table = "tool_hint"

Definition at line 41 of file tool_hint.inc.


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