/** * get singleton instance */ public function factory() { if (isset(self::$instance) and self::$instance) { return self::$instance; } return self::$instance = new ilSearchCommandQueue(); }
protected static function storeElement($a_command, $a_params) { global $ilLog; if (!$a_command) { return false; } if (!isset($a_params['obj_id']) or !$a_params['obj_id']) { return false; } if (!isset($a_params['obj_type']) or !$a_params['obj_type']) { $a_params['obj_type'] = ilObject::_lookupType($a_params['obj_id']); } $ilLog->write(__METHOD__ . ': Handling new command: ' . $a_command . ' for type ' . $a_params['obj_type']); $element = new ilSearchCommandQueueElement(); $element->setObjId($a_params['obj_id']); $element->setObjType($a_params['obj_type']); $element->setCommand($a_command); ilSearchCommandQueue::factory()->store($element); return true; }