ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSearchCommandQueue Class Reference
+ Collaboration diagram for ilSearchCommandQueue:

Public Member Functions

 factory ()
 get singleton instance
 store (ilSearchCommandQueueElement $element)
 update / save new entry

Protected Member Functions

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

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

ilSearchCommandQueue::__construct ( )
protected

Constructor.

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

{
}

Member Function Documentation

ilSearchCommandQueue::factory ( )

get singleton instance

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

References $instance.

Referenced by ilSearchAppEventListener\storeElement().

{
if(isset(self::$instance) and self::$instance)
{
}
return self::$instance = new ilSearchCommandQueue();
}

+ Here is the caller graph for this function:

ilSearchCommandQueue::insert ( ilSearchCommandQueueElement  $element)
protected

Insert new entry.

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

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

Referenced by store().

{
global $ilDB;
$query = "INSERT INTO search_command_queue (obj_id,obj_type,sub_id,sub_type,command,last_update,finished) ".
"VALUES( ".
$ilDB->quote($element->getObjId() ,'integer').", ".
$ilDB->quote($element->getObjType() ,'text').", ".
"0, ".
"'',".
$ilDB->quote($element->getCommand() ,'text').", ".
$ilDB->now().", ".
"0 ".
")";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSearchCommandQueue::store ( ilSearchCommandQueueElement  $element)

update / save new entry

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

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

{
global $ilDB;
$query = "SELECT obj_id, obj_type FROM search_command_queue ".
"WHERE obj_id = ".$ilDB->quote($element->getObjId() ,'integer')." ".
"AND obj_type = ".$ilDB->quote($element->getObjType() ,'text');
$res = $ilDB->query($query);
if($res->numRows())
{
$this->update($element);
}
else
{
$this->insert($element);
}
}

+ Here is the call graph for this function:

ilSearchCommandQueue::update ( ilSearchCommandQueueElement  $element)
protected

Update existing entry.

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

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

Referenced by store().

{
global $ilDB;
$query = "UPDATE search_command_queue ".
"SET command = ".$ilDB->quote($element->getCommand() ,'text').", ".
"last_update = ".$ilDB->now().", ".
"finished = ".$ilDB->quote(0 ,'integer')." ".
"WHERE obj_id = ".$ilDB->quote($element->getObjId() ,'integer')." ".
"AND obj_type = ".$ilDB->quote($element->getObjType() ,'text');
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

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: