ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSearchCommandQueue.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 private static ?self $instance = null;
31
32 protected ilDBInterface $db;
33
37 protected function __construct()
38 {
39 global $DIC;
40
41 $this->db = $DIC->database();
42 }
43
47 public static function factory(): ilSearchCommandQueue
48 {
49 if (self::$instance instanceof ilSearchCommandQueue) {
50 return self::$instance;
51 }
52 return self::$instance = new ilSearchCommandQueue();
53 }
54
58 public function store(ilSearchCommandQueueElement $element): void
59 {
60 $this->db->replace(
61 'search_command_queue',
62 [
63 'obj_id' => [ilDBConstants::T_INTEGER, $element->getObjId()],
64 'obj_type' => [ilDBConstants::T_TEXT, $element->getObjType()],
65 'sub_id' => [ilDBConstants::T_INTEGER, 0]
66 ],
67 [
68 'sub_type' => [ilDBConstants::T_TEXT, ''],
69 'command' => [ilDBConstants::T_TEXT, $element->getCommand()],
70 'last_update' => [ilDBConstants::T_DATE, $this->db->now()],
71 'finished' => [ilDBConstants::T_INTEGER, 0]
72 ]
73 );
74 }
75}
Represents an entry for the search command queue.
store(ilSearchCommandQueueElement $element)
update / save new entry
static factory()
get singleton instance
Interface ilDBInterface.
global $DIC
Definition: shib_login.php:26