protected function transformToDocuments($auditLogs)
    {
        $index = $this->getIndex();
        $type = $this->getType();
        $documents = [];
        foreach ($auditLogs as $log) {
            $primary = $log->getId();
            $primary = is_array($primary) ? array_values($primary) : $primary;
            $eventType = $log->getEventType();
            $data = [
                '@timestamp' => $log->getTimestamp(),
                'transaction' => $log->getTransactionId(),
                'type' => $eventType,
                'primary_key' => $primary,
                'source' => $log->getSourceName(),
                'parent_source' => $log->getParentSourceName(),
                'original' => $eventType === 'delete' ? null : $log->getOriginal(),
                'changed' => $eventType === 'delete' ? null : $log->getChanged(),
                'meta' => $log->getMetaInfo()
            ];
            $id = $this->useTransactionId ? $log->getTransactionId() : '';
            $documents[] = new Document($id, $data, $type, $index);
        }

        return $documents;
    }
protected function transformToDocuments($auditLogs)
    {
        $index = $this->getIndex();
        $type = $this->getType();
        $documents = [];
        foreach ($auditLogs as $log) {
            $primary = $log->getId();
            $primary = is_array($primary) ? array_values($primary) : $primary;
            $eventType = $log->getEventType();
            $data = [
                '@timestamp' => $log->getTimestamp(),
                'transaction' => $log->getTransactionId(),
                'type' => $eventType,
                'primary_key' => $primary,
                'source' => $log->getSourceName(),
                'parent_source' => $log->getParentSourceName(),
                'original' => $eventType === 'delete' ? null : $log->getOriginal(),
                'changed' => $eventType === 'delete' ? null : $log->getChanged(),
                'meta' => $log->getMetaInfo()
            ];
            $id = $this->useTransactionId ? $log->getTransactionId() : '';
            $documents[] = new Document($id, $data, $type, $index);
        }

        return $documents;
    }
protected function transformToDocuments ( $ auditLogs ) { $ index = $ this -> getIndex ( ) ; $ type = $ this -> getType ( ) ; $ documents = [ ] ; foreach ( $ auditLogs as $ log ) { $ primary = $ log -> getId ( ) ; $ primary = is_array ( $ primary ) ? array_values ( $ primary ) : $ primary ; $ eventType = $ log -> getEventType ( ) ; $ data = [ '@timestamp' => $ log -> getTimestamp ( ) , 'transaction' => $ log -> getTransactionId ( ) , 'type' => $ eventType , 'primary_key' => $ primary , 'source' => $ log -> getSourceName ( ) , 'parent_source' => $ log -> getParentSourceName ( ) , 'original' => $ eventType === 'delete' ? null : $ log -> getOriginal ( ) , 'changed' => $ eventType === 'delete' ? null : $ log -> getChanged ( ) , 'meta' => $ log -> getMetaInfo ( ) ] ; $ id = $ this -> useTransactionId ? $ log -> getTransactionId ( ) : '' ; $ documents [ ] = new Document ( $ id , $ data , $ type , $ index ) ; } return $ documents ; }
Transforms the EventInterface objects to Elastica Documents.

@param array $auditLogs An array of EventInterface objects.
@return array
Transforms the EventInterface objects to Elastica Documents .