public function logEvents(array $auditLogs)
    {
        $PersisterTable = $this->getTable();

        $serializeFields = $this->getConfig('serializeFields');
        $primaryKeyExtractionStrategy = $this->getConfig('primaryKeyExtractionStrategy');
        $extractMetaFields = $this->getConfig('extractMetaFields');
        $unsetExtractedMetaFields = $this->getConfig('unsetExtractedMetaFields');
        $logErrors = $this->getConfig('logErrors');

        foreach ($auditLogs as $log) {
            $fields = $this->extractBasicFields($log, $serializeFields);
            $fields += $this->extractPrimaryKeyFields($log, $primaryKeyExtractionStrategy);
            $fields += $this->extractMetaFields(
                $log, $extractMetaFields, $unsetExtractedMetaFields, $serializeFields
            );

            $persisterEntity = $PersisterTable->newEntity($fields);

            if (!$PersisterTable->save($persisterEntity) &&
                $logErrors
            ) {
                $this->log($this->toErrorLog($persisterEntity));
            }
        }
    }
public function logEvents(array $auditLogs)
    {
        $PersisterTable = $this->getTable();

        $serializeFields = $this->getConfig('serializeFields');
        $primaryKeyExtractionStrategy = $this->getConfig('primaryKeyExtractionStrategy');
        $extractMetaFields = $this->getConfig('extractMetaFields');
        $unsetExtractedMetaFields = $this->getConfig('unsetExtractedMetaFields');
        $logErrors = $this->getConfig('logErrors');

        foreach ($auditLogs as $log) {
            $fields = $this->extractBasicFields($log, $serializeFields);
            $fields += $this->extractPrimaryKeyFields($log, $primaryKeyExtractionStrategy);
            $fields += $this->extractMetaFields(
                $log, $extractMetaFields, $unsetExtractedMetaFields, $serializeFields
            );

            $persisterEntity = $PersisterTable->newEntity($fields);

            if (!$PersisterTable->save($persisterEntity) &&
                $logErrors
            ) {
                $this->log($this->toErrorLog($persisterEntity));
            }
        }
    }
public function logEvents ( array $ auditLogs ) { $ PersisterTable = $ this -> getTable ( ) ; $ serializeFields = $ this -> getConfig ( 'serializeFields' ) ; $ primaryKeyExtractionStrategy = $ this -> getConfig ( 'primaryKeyExtractionStrategy' ) ; $ extractMetaFields = $ this -> getConfig ( 'extractMetaFields' ) ; $ unsetExtractedMetaFields = $ this -> getConfig ( 'unsetExtractedMetaFields' ) ; $ logErrors = $ this -> getConfig ( 'logErrors' ) ; foreach ( $ auditLogs as $ log ) { $ fields = $ this -> extractBasicFields ( $ log , $ serializeFields ) ; $ fields += $ this -> extractPrimaryKeyFields ( $ log , $ primaryKeyExtractionStrategy ) ; $ fields += $ this -> extractMetaFields ( $ log , $ extractMetaFields , $ unsetExtractedMetaFields , $ serializeFields ) ; $ persisterEntity = $ PersisterTable -> newEntity ( $ fields ) ; if ( ! $ PersisterTable -> save ( $ persisterEntity ) && $ logErrors ) { $ this -> log ( $ this -> toErrorLog ( $ persisterEntity ) ) ; } } }
Persists each of the passed EventInterface objects.

@param \AuditStash\EventInterface[] $auditLogs List of EventInterface objects to persist
@return void
Persists each of the passed EventInterface objects .