/** * Update existing entry */ protected function update(ilSearchCommandQueueElement $element) { 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; }
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; }