protected function getData(array $context)
    {
        $data = [];
        switch ($context['action']) {
            case 'UPDATE':
                $diff = $this->diff($context['old'], $context['new']);
                foreach ($diff as $item) {
                    list($k, $old, $new) = $item;
                    if (isset($context['new'][$k])) {
                        $data[$k] = [$old, $new];
                    }
                }
                break;
            case 'INSERT':
                foreach ($context['new'] as $k => $val) {
                    $data[$k] = [null, $val];
                }
                break;
            case 'DELETE':
                foreach ($context['old'] as $k => $val) {
                    $data[$k] = [$val, null];
                }
                break;
        }

        return $data;
    }
protected function getData(array $context)
    {
        $data = [];
        switch ($context['action']) {
            case 'UPDATE':
                $diff = $this->diff($context['old'], $context['new']);
                foreach ($diff as $item) {
                    list($k, $old, $new) = $item;
                    if (isset($context['new'][$k])) {
                        $data[$k] = [$old, $new];
                    }
                }
                break;
            case 'INSERT':
                foreach ($context['new'] as $k => $val) {
                    $data[$k] = [null, $val];
                }
                break;
            case 'DELETE':
                foreach ($context['old'] as $k => $val) {
                    $data[$k] = [$val, null];
                }
                break;
        }

        return $data;
    }
protected function getData ( array $ context ) { $ data = [ ] ; switch ( $ context [ 'action' ] ) { case 'UPDATE' : $ diff = $ this -> diff ( $ context [ 'old' ] , $ context [ 'new' ] ) ; foreach ( $ diff as $ item ) { list ( $ k , $ old , $ new ) = $ item ; if ( isset ( $ context [ 'new' ] [ $ k ] ) ) { $ data [ $ k ] = [ $ old , $ new ] ; } } break ; case 'INSERT' : foreach ( $ context [ 'new' ] as $ k => $ val ) { $ data [ $ k ] = [ null , $ val ] ; } break ; case 'DELETE' : foreach ( $ context [ 'old' ] as $ k => $ val ) { $ data [ $ k ] = [ $ val , null ] ; } break ; } return $ data ; }
Get the context data.

@param array $context

@return array
Get the context data .