Restore unknown event.

@param array $data
@param array $logextra
@return unknown_logged
482437
protected static final function restore_unknown(array $data, array $logextra) {
        $classname = '\core\event\unknown_logged';

        /** @var unknown_logged $event */
        $event = new $classname();
        $event->restored = true;
        $event->triggered = true;
        $event->dispatched = true;
        $event->data = $data;
        $event->logextra = $logextra;

        return $event;
    }
18005
protected function restoreExtractedData($content)
    {
        if (!$this->extracted) {
            // nothing was extracted, nothing to restore
            return $content;
        }

        $content = strtr($content, $this->extracted);

        $this->extracted = array();

        return $content;
    }
1167560
public function onData($data)
    {
        if (!$this->handshaked) {
            return $this->handshake($data);
        }
        return $this->handle($data);
    }
222518
public function fromArray(LoggerInterface $logger, array $data, string $useragent): BrowserInterface
    {
        $name  = array_key_exists('name', $data) ? $data['name'] : null;
        $modus = array_key_exists('modus', $data) ? $data['modus'] : null;
        $bits  = (new \BrowserDetector\Bits\Browser())->getBits($useragent);

        $type = new Unknown();
        if (array_key_exists('type', $data)) {
            try {
                $type = $this->typeLoader->load((string) $data['type']);
            } catch (NotFoundException $e) {
                $logger->info($e);
            }
        }

        $version      = $this->getVersion($data, $useragent);
        $manufacturer = $this->getCompany($logger, $data, $useragent, 'manufacturer');

        return new Browser($name, $manufacturer, $version, $type, $bits, $modus);
    }
1061740
protected function prepareData($data)
    {
        $callback = function ($value) {
            return $value !== null && $value !== [] && $value !== '';
        };

        foreach ($data as &$value) {
            if (is_array($value)) {
                $value = $this->prepareData($value);
            }
        }
        return array_filter($data, $callback);
    }
1208306
final public function process($data) {
        if (!array_key_exists($data['path'], $this->pathelements)) { // Incorrect path, must not happen
            throw new restore_step_exception('restore_structure_step_missing_path', $data['path']);
        }
        $element = $this->pathelements[$data['path']];
        $object = $element->get_processing_object();
        $method = $element->get_processing_method();
        $rdata = null;
        if (empty($object)) { // No processing object defined
            throw new restore_step_exception('restore_structure_step_missing_pobject', $object);
        }
        // Release the lock if we aren't anymore within children of it
        if (!is_null($this->pathlock) and strpos($data['path'], $this->pathlock) === false) {
            $this->pathlock = null;
        }
        if (is_null($this->pathlock)) { // Only dispatch if there isn't any lock
            $rdata = $object->$method($data['tags']); // Dispatch to proper object/method
        }

        // If the dispatched method returns SKIP_ALL_CHILDREN, we grab current path in order to
        // lock dispatching to any children
        if ($rdata === self::SKIP_ALL_CHILDREN) {
            // Check we haven't any previous lock
            if (!is_null($this->pathlock)) {
                throw new restore_step_exception('restore_structure_step_already_skipping', $data['path']);
            }
            // Set the lock
            $this->pathlock = $data['path'] . '/'; // Lock everything below current path

        // Continue with normal processing of return values
        } else if ($rdata !== null) { // If the method has returned any info, set element data to it
            $element->set_data($rdata);
        } else {               // Else, put the original parsed data
            $element->set_data($data);
        }
    }
1011132
public function triggerEvent($eventId, ObjectCollection $orderItems, array $logContext, array $data = [])
    {
        return $this->omsFacade->triggerEvent($eventId, $orderItems, $logContext, $data);
    }
1205611
public function saveRawData( array $data )
    {
        if ( ! parent::save( $data ) )
        {
            return null;
        }

        return isset( $data['id'] ) ? $data['id'] : null;
    }
1163072
protected static function saveExtraParams(array $data)
    {
        $final_data = array();
        if (count($data) > 0) {
            Logger::log('Saving extra configuration parameters');
            foreach ($data as $key => $value) {
                if (null !== $value || $value !== '') {
                    $final_data[$key] = $value;
                }
            }
        }
        return $final_data;
    }
388000
public function withData($data): self
    {
        $new = clone $this;
        $new->data = $data instanceof MessageData ? $data : MessageData::fromArray($data);

        return $new;
    }
1150030
public function createNew($data)
    {
        foreach ($this->handlers as $handler) {
            $result = $handler->createNew($data);
            if ($result) {
                return $result;
            }
        }

        return null;
    }
8844
public function trace($message, $data)
    {
        // TODO: Implement trace() method.
        $this->logMessages->enqueue([
            'date'    => date('Y-m-d H:i:s'),
            'message' => $message,
            'data'    => $data
        ]);

        return $this;
    }
1368199
protected function logInitialization(array $logData)
    {
        if (!$this->site->getSolrConfiguration()->getLoggingIndexingIndexQueueInitialization()) {
            return;
        }

        $logSeverity = isset($logData['error']) ? SolrLogManager::ERROR : SolrLogManager::NOTICE;
        $logData = array_merge($logData, [
            'site' => $this->site->getLabel(),
            'indexing configuration name' => $this->indexingConfigurationName,
            'type' => $this->type,
        ]);

        $message = 'Index Queue initialized for indexing configuration ' . $this->indexingConfigurationName;
        $this->logger->log($logSeverity, $message, $logData);
    }
709493
public function successData($data, $msg = null, $extraData = [])
    {
        $return = $this->output(1, $msg, $data, $extraData);

        return $this->responseJson($return);
    }
695606
public function addLog($data)
    {
        /* @var \Phalcon\Http\Request */
        $request = Di::getDefault()->getRequest();

        if (empty($data['ip_address'])) {
            $data['ip_address'] = $request->getClientAddress();
        }

        if (empty($data['user_agent'])) {
            $data['user_agent'] = $request->getUserAgent();
        }

        return $this->save($data);
    }
1083942
private function logError($exception, array $additionalData = [])
    {
        $logger = (new Logger($exception));

        if(count($additionalData)){
            $logger->addAdditionalData($additionalData);
        }

        $logger->send();
    }
950823
private function persistRecord(array $data, array $fillable = array(), $set)
    {
        if (!empty($fillable) && !ArrayUtils::keysExist($data, $fillable)) {
            throw new LogicException('Can not persist the entity due to fillable protection. Make sure all fillable keys exist in the entity');
        }

        $this->validateShortcutData();

        if (isset($data[$this->getPk()]) && $data[$this->getPk()]) {
            $result = $this->db->update(static::getTableName(), $data)
                               ->whereEquals($this->getPk(), $data[$this->getPk()])
                               ->execute();

            return $set === true ? $data : $result;

        } else {
            // Do not insert primary key if present
            if (array_key_exists($this->getPk(), $data)) {
                unset($data[$this->getPk()]);
            }

            // Insert a new row without PK
            $result = $this->db->insert(static::getTableName(), $data)
                               ->execute();

            if ($set === true) {
                // Append a PK in result-set now
                $data[$this->getPk()] = $this->getMaxId();
                return $data;
            } else {
                return $result;
            }
        }
    }