ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSearchCommandQueue Class Reference
+ Collaboration diagram for ilSearchCommandQueue:

Public Member Functions

 store (ilSearchCommandQueueElement $element)
 update / save new entry More...
 

Static Public Member Functions

static factory ()
 get singleton instance More...
 

Protected Member Functions

 __construct ()
 Constructor. More...
 
 insert (ilSearchCommandQueueElement $element)
 Insert new entry. More...
 
 update (ilSearchCommandQueueElement $element)
 Update existing entry. More...
 

Static Private Attributes

static $instance = null
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilSearchCommandQueue::__construct ( )
protected

Constructor.

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

43  {
44  }

Member Function Documentation

◆ factory()

static ilSearchCommandQueue::factory ( )
static

get singleton instance

Definition at line 49 of file class.ilSearchCommandQueue.php.

Referenced by ilSearchAppEventListener\storeElement().

50  {
51  if (isset(self::$instance) and self::$instance) {
52  return self::$instance;
53  }
54  return self::$instance = new ilSearchCommandQueue();
55  }
+ Here is the caller graph for this function:

◆ insert()

ilSearchCommandQueue::insert ( ilSearchCommandQueueElement  $element)
protected

Insert new entry.

Definition at line 80 of file class.ilSearchCommandQueue.php.

References $DIC, $ilDB, $query, $res, ilSearchCommandQueueElement\getCommand(), ilSearchCommandQueueElement\getObjId(), and ilSearchCommandQueueElement\getObjType().

Referenced by store().

81  {
82  global $DIC;
83 
84  $ilDB = $DIC['ilDB'];
85 
86  $query = "INSERT INTO search_command_queue (obj_id,obj_type,sub_id,sub_type,command,last_update,finished) " .
87  "VALUES( " .
88  $ilDB->quote($element->getObjId(), 'integer') . ", " .
89  $ilDB->quote($element->getObjType(), 'text') . ", " .
90  "0, " .
91  "''," .
92  $ilDB->quote($element->getCommand(), 'text') . ", " .
93  $ilDB->now() . ", " .
94  "0 " .
95  ")";
96  $res = $ilDB->manipulate($query);
97  return true;
98  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store()

ilSearchCommandQueue::store ( ilSearchCommandQueueElement  $element)

update / save new entry

Definition at line 60 of file class.ilSearchCommandQueue.php.

References $DIC, $ilDB, $query, $res, ilSearchCommandQueueElement\getObjId(), ilSearchCommandQueueElement\getObjType(), insert(), and update().

61  {
62  global $DIC;
63 
64  $ilDB = $DIC['ilDB'];
65 
66  $query = "SELECT obj_id, obj_type FROM search_command_queue " .
67  "WHERE obj_id = " . $ilDB->quote($element->getObjId(), 'integer') . " " .
68  "AND obj_type = " . $ilDB->quote($element->getObjType(), 'text');
69  $res = $ilDB->query($query);
70  if ($res->numRows()) {
71  $this->update($element);
72  } else {
73  $this->insert($element);
74  }
75  }
global $DIC
Definition: saml.php:7
insert(ilSearchCommandQueueElement $element)
Insert new entry.
update(ilSearchCommandQueueElement $element)
Update existing entry.
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ update()

ilSearchCommandQueue::update ( ilSearchCommandQueueElement  $element)
protected

Update existing entry.

Definition at line 103 of file class.ilSearchCommandQueue.php.

References $DIC, $ilDB, $query, $res, ilSearchCommandQueueElement\getCommand(), ilSearchCommandQueueElement\getObjId(), and ilSearchCommandQueueElement\getObjType().

Referenced by store().

104  {
105  global $DIC;
106 
107  $ilDB = $DIC['ilDB'];
108 
109  $query = "UPDATE search_command_queue " .
110  "SET command = " . $ilDB->quote($element->getCommand(), 'text') . ", " .
111  "last_update = " . $ilDB->now() . ", " .
112  "finished = " . $ilDB->quote(0, 'integer') . " " .
113  "WHERE obj_id = " . $ilDB->quote($element->getObjId(), 'integer') . " " .
114  "AND obj_type = " . $ilDB->quote($element->getObjType(), 'text');
115  $res = $ilDB->manipulate($query);
116  return true;
117  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $instance

ilSearchCommandQueue::$instance = null
staticprivate

Definition at line 36 of file class.ilSearchCommandQueue.php.


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