Persists statistics record

@param array $statisticsRecord
@return void
323800
public function saveStatisticsRecord(array $statisticsRecord)
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->insert($this->table)->values($statisticsRecord)->execute();
    }
1131486
public function setFields (array $fields)
    {
        $this->_fields = array();
        $this->_records = array();
        $prevLevel = null;
        foreach ($fields as $field) {
            $level = $field->getLevel();
            if ($level === 0) {
                $this->append($field);
            } else {
                if ($level === 1 && $prevLevel !== 1) {
                    $localRecord = new LocalRecord(array($field));
                    $this->addLocalRecord($localRecord);
                } else {
                    $records = $this->getLocalRecords();
                    // Handle malformed Pica record w/ missing local record field
                    if (empty($records)) {
                        $localRecord = new LocalRecord();
                        $this->addLocalRecord($localRecord);
                    } else {
                        $localRecord = end($records);
                    }
                    if ($level === 1) {
                        $localRecord->append($field);
                    } else {
                        $copyRecord = $localRecord->getCopyRecordByItemNumber($field->getOccurrence());
                        if ($copyRecord) {
                            $copyRecord->append($field);
                        } else {
                            $localRecord->addCopyRecord(new CopyRecord(array($field)));
                        }
                    }
                }
            }
            $prevLevel = $level;
        }
    }
920704
protected function write(array $record)
    {
        if (!$this->isBatchHandling) {
            $this->contentBuffer = $record['formatted'];
            $this->publishContent();
        }
        else {
            $this->contentBuffer = $record['formatted'] . $this->contentBuffer;
        }
    }
479811
protected function write(array $record): void
    {
        try
        {
            $this->streamWriter->write((string) $record['formatted']);
        }
        // @codeCoverageIgnoreStart
        catch (\Throwable $throwable)
        {
            /** Not interest */
        }
        // @codeCoverageIgnoreEnd
    }
885097
public static function run($models, &$stats = [])
    {
        static::loadFixers();

        foreach ($models as $path => $model) {
            $file = new \SplFileInfo($path);
            list($content, $changed) = static::doRun($file, $model);
            if ($changed) {
                static::updateFile($file, $content);
                $stats[] = sprintf('%s:%s', $model->getMeta()->getAppName(), $model->getMeta()->getModelName());
            }
        }
    }
129781
protected function loadStatsArray() {
        if (!is_array($this->stats)) {
            $stats = $this->instance->loadStatus($this->cacheKeyPrefix, $this->cacheKeySuffix);
            if (!empty($stats)) {
                $this->stats = unserialize($stats);
            }

            // make sure unserialize and load were successfull and we have array
            if (!is_array($this->stats)) {
                $this->stats = array();
            }
        }
    }
124134
protected function write( array $record )
    {
        if ($this->_debugbar->hasCollector('log') && $this->_debugbar->shouldCollect('log') ) {
            $type = array_keys( $this->_levelMap,$record['level_name']);
            $this->_debugbar->getCollector('log')
                ->add( $record['message'], end($type), microtime(true), $record['context']);
        }
    }
1043875
public function persistData()
    {
        $handlers = $this->getHandlers();

        foreach ($handlers as $handler) {
            /** @var $handler \Wurfl\Handlers\AbstractHandler */
            $handler->setLogger($this->logger);

            $handler->persistData();
        }
    }
1196317
protected function insertDayReports()
    {
        /** @var DataTable $dataTable */
        $dataTable = $this->arrays->asDataTable();
        $this->setVisitorIds($dataTable);
        $report = $dataTable->getSerialized($this->maximumRowsInDataTableLevelZero, null, Metrics::INDEX_NB_VISITS);
        $this->getProcessor()->insertBlobRecord(self::USERID_ARCHIVE_RECORD, $report);
    }
1156786
protected function persist() {
		$record = SentEmail::create(array(
			'To' => $this->To(),
			'From' => $this->From(),
			'Subject' => $this->Subject(),
			'Body' => $this->Body(),
			'CC' => $this->CC(),
			'BCC' => $this->BCC(),
			'SerializedEmail' => serialize($this)
		));		
		$record->write();

		return $record;
	}
622795
public function write($records)
    {
        // Array for tracking successfully harvested IDs:
        $harvestedIds = [];

        // Date of most recent record encountered:
        $endDate = 0;

        $this->strategy->beginWrite();

        // Loop through the records:
        foreach ($records as $record) {
            // Die if the record is missing its header:
            if (empty($record->header)) {
                throw new \Exception('Unexpected missing record header.');
            }

            // Get the ID of the current record:
            $id = $this->extractID($record);

            // Save the current record, either as a deleted or as a regular file:
            $attribs = $record->header->attributes();
            if (strtolower($attribs['status']) == 'deleted') {
                $this->strategy->addDeletedRecord($id);
            } else {
                $recordXML = $this->recordFormatter->format($id, $record);
                $this->strategy->addRecord($id, $recordXML);
                $harvestedIds[] = $id;
            }

            // If the current record's date is newer than the previous end date,
            // remember it for future reference:
            $date = $this->normalizeDate($record->header->datestamp);
            if ($date && $date > $endDate) {
                $endDate = $date;
            }
        }

        $this->strategy->endWrite();

        $this->writeHarvestedIdsLog($harvestedIds);

        return $endDate;
    }
793914
public final function setRecord ($params)
    {
        foreach ($params as $key => $param) {
            if (! in_array($key, $this->getColumn())) {
                unset($params->{$key});
            }
        }

        $this->record = $params;
    }
639009
public function persistData()
    {
        // we sort the array first, useful for doing ris match
        if (!empty($this->userAgentsWithDeviceID)) {
            ksort($this->userAgentsWithDeviceID);

            $this->persistenceProvider->save($this->getPrefix(), $this->userAgentsWithDeviceID);
            $this->persistenceProvider->save($this->getPrefix(self::PREFIX_OVERWRITTEN), $this->overwritten_devices);
            $this->persistenceProvider->save($this->getPrefix(self::PREFIX_UA_BUCKET), array_keys($this->userAgentsWithDeviceID));
        }
    }
864773
protected function write(array $record)
    {
        $this->connectIfNotConnected();
        $data = $this->generateDataStream($record);
        $this->writeToSocket($data);
    }
852092
public function persistBulk($documents)
    {
        if (empty($documents)) {
            $this->log('No more documents to index', 'info');
            return;
        }
        $this->log(sprintf('Indexing %d documents', count($documents)), 'info');
        ConnectionManager::get('auditlog_elastic')->addDocuments($documents);
    }
1321216
public function decrement($stats, $sampleRate = 1, array $tags = null)
    {
        return $this->updateStats($stats, -1, $sampleRate, $tags);
    }
709724
public function persist(object $document) : void
    {
        $class = $this->dm->getClassMetadata(get_class($document));
        if ($class->isMappedSuperclass || $class->isQueryResultDocument) {
            throw MongoDBException::cannotPersistMappedSuperclass($class->name);
        }
        $visited = [];
        $this->doPersist($document, $visited);
    }