ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

50 {
51 if (isset(self::$instance) and self::$instance) {
52 return self::$instance;
53 }
54 return self::$instance = new ilSearchCommandQueue();
55 }

References $instance.

Referenced by ilSearchAppEventListener\storeElement().

+ Here is the caller graph for this function:

◆ insert()

ilSearchCommandQueue::insert ( ilSearchCommandQueueElement  $element)
protected

Insert new entry.

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

79 {
80 global $ilDB;
81
82 $query = "INSERT INTO search_command_queue (obj_id,obj_type,sub_id,sub_type,command,last_update,finished) " .
83 "VALUES( " .
84 $ilDB->quote($element->getObjId(), 'integer') . ", " .
85 $ilDB->quote($element->getObjType(), 'text') . ", " .
86 "0, " .
87 "''," .
88 $ilDB->quote($element->getCommand(), 'text') . ", " .
89 $ilDB->now() . ", " .
90 "0 " .
91 ")";
92 $res = $ilDB->manipulate($query);
93 return true;
94 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB

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

Referenced by store().

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

61 {
62 global $ilDB;
63
64 $query = "SELECT obj_id, obj_type FROM search_command_queue " .
65 "WHERE obj_id = " . $ilDB->quote($element->getObjId(), 'integer') . " " .
66 "AND obj_type = " . $ilDB->quote($element->getObjType(), 'text');
67 $res = $ilDB->query($query);
68 if ($res->numRows()) {
69 $this->update($element);
70 } else {
71 $this->insert($element);
72 }
73 }
insert(ilSearchCommandQueueElement $element)
Insert new entry.
update(ilSearchCommandQueueElement $element)
Update existing entry.

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

+ Here is the call graph for this function:

◆ update()

ilSearchCommandQueue::update ( ilSearchCommandQueueElement  $element)
protected

Update existing entry.

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

100 {
101 global $ilDB;
102
103 $query = "UPDATE search_command_queue " .
104 "SET command = " . $ilDB->quote($element->getCommand(), 'text') . ", " .
105 "last_update = " . $ilDB->now() . ", " .
106 "finished = " . $ilDB->quote(0, 'integer') . " " .
107 "WHERE obj_id = " . $ilDB->quote($element->getObjId(), 'integer') . " " .
108 "AND obj_type = " . $ilDB->quote($element->getObjType(), 'text');
109 $res = $ilDB->manipulate($query);
110 return true;
111 }

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

Referenced by store().

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

Referenced by factory().


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