public function eventFormatter($audit, $index, $meta = [])
    {
        $data = [
            '@timestamp' => $audit['created'],
            'transaction' => $audit['id'],
            'type' => $audit['event'] === 'EDIT' ? 'update' : strtolower($audit['event']),
            'primary_key' => $audit['entity_id'],
            'original' => $audit['original'],
            'changed' => $audit['changed'],
            'meta' => $meta + [
                'ip' => $audit['source_ip'],
                'url' => $audit['source_url'],
                'user' => $audit['source_id'],
            ]
        ];

        $index = sprintf($index, \DateTime::createFromFormat('Y-m-d H:i:s', $audit['created'])->format('-Y.m.d'));
        $type = isset($map[$audit['model']]) ? $map[$audit['model']] : Inflector::tableize($audit['model']);
        return new Document($audit['id'], $data, $type, $index);
    }
public function eventFormatter($audit, $index, $meta = [])
    {
        $data = [
            '@timestamp' => $audit['created'],
            'transaction' => $audit['id'],
            'type' => $audit['event'] === 'EDIT' ? 'update' : strtolower($audit['event']),
            'primary_key' => $audit['entity_id'],
            'original' => $audit['original'],
            'changed' => $audit['changed'],
            'meta' => $meta + [
                'ip' => $audit['source_ip'],
                'url' => $audit['source_url'],
                'user' => $audit['source_id'],
            ]
        ];

        $index = sprintf($index, \DateTime::createFromFormat('Y-m-d H:i:s', $audit['created'])->format('-Y.m.d'));
        $type = isset($map[$audit['model']]) ? $map[$audit['model']] : Inflector::tableize($audit['model']);
        return new Document($audit['id'], $data, $type, $index);
    }
public function eventFormatter ( $ audit , $ index , $ meta = [ ] ) { $ data = [ '@timestamp' => $ audit [ 'created' ] , 'transaction' => $ audit [ 'id' ] , 'type' => $ audit [ 'event' ] === 'EDIT' ? 'update' : strtolower ( $ audit [ 'event' ] ) , 'primary_key' => $ audit [ 'entity_id' ] , 'original' => $ audit [ 'original' ] , 'changed' => $ audit [ 'changed' ] , 'meta' => $ meta + [ 'ip' => $ audit [ 'source_ip' ] , 'url' => $ audit [ 'source_url' ] , 'user' => $ audit [ 'source_id' ] , ] ] ; $ index = sprintf ( $ index , \ DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ audit [ 'created' ] ) -> format ( '-Y.m.d' ) ) ; $ type = isset ( $ map [ $ audit [ 'model' ] ] ) ? $ map [ $ audit [ 'model' ] ] : Inflector :: tableize ( $ audit [ 'model' ] ) ; return new Document ( $ audit [ 'id' ] , $ data , $ type , $ index ) ; }
Converts the single audit log event array into a Elastica\Document so it can be stored.

@param array $audit The audit log information
@param string $index The name of the index where the event should be stored
@param array $meta The meta information to append to the meta array
@return Elastica\Document
Converts the single audit log event array into a Elastica \ Document so it can be stored .