ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSearchCommandQueue Class Reference
+ Collaboration diagram for ilSearchCommandQueue:

Public Member Functions

 factory ()
 get singleton instance More...
 
 store (ilSearchCommandQueueElement $element)
 update / save new entry 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
45 }

Member Function Documentation

◆ factory()

ilSearchCommandQueue::factory ( )

get singleton instance

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

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

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 83 of file class.ilSearchCommandQueue.php.

84 {
85 global $ilDB;
86
87 $query = "INSERT INTO search_command_queue (obj_id,obj_type,sub_id,sub_type,command,last_update,finished) ".
88 "VALUES( ".
89 $ilDB->quote($element->getObjId() ,'integer').", ".
90 $ilDB->quote($element->getObjType() ,'text').", ".
91 "0, ".
92 "'',".
93 $ilDB->quote($element->getCommand() ,'text').", ".
94 $ilDB->now().", ".
95 "0 ".
96 ")";
97 $res = $ilDB->manipulate($query);
98 return true;
99 }
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 62 of file class.ilSearchCommandQueue.php.

63 {
64 global $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 {
72 $this->update($element);
73 }
74 else
75 {
76 $this->insert($element);
77 }
78 }
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 104 of file class.ilSearchCommandQueue.php.

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

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: