PHP Class PartKeepr\ExportBundle\EventListener\AbstractResponderViewListener

显示文件 Open project: partkeepr/PartKeepr

Public Methods

Method Description
onKernelView ( GetResponseForControllerResultEvent $event ) : Response | mixed Converts the response to an exported format.

Protected Methods

Method Description
flatten ( $data, $mappings ) : array Flattens the given data. Uses the property accessor to retrieve nested data.
getWriter ( $file ) : Exporter\Writer\WriterInterface Returns the writer.

Method Details

flatten() protected method

Flattens the given data. Uses the property accessor to retrieve nested data.
protected flatten ( $data, $mappings ) : array
$data array The data, typically an array of entities
$mappings array The mappings as array, e.g. [ "name", "description", "storageLocation.name" ]
return array

getWriter() abstract protected method

Returns the writer.
abstract protected getWriter ( $file ) : Exporter\Writer\WriterInterface
$file
return Exporter\Writer\WriterInterface

onKernelView() public method

Converts the response to an exported format.
public onKernelView ( GetResponseForControllerResultEvent $event ) : Response | mixed
$event Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent
return Symfony\Component\HttpFoundation\Response | mixed