2012-04-12 01:28:36 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Nelmio\ApiBundle\Formatter;
|
|
|
|
|
|
|
|
class SimpleFormatter extends AbstractFormatter
|
|
|
|
{
|
2012-04-12 12:48:36 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function renderOne(array $data)
|
2012-04-12 01:28:36 +02:00
|
|
|
{
|
|
|
|
return $data;
|
|
|
|
}
|
2012-04-12 12:48:36 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2012-04-12 17:24:38 +02:00
|
|
|
protected function renderResourceSection($resource, array $arrayOfData)
|
|
|
|
{
|
|
|
|
return array($resource => $arrayOfData);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function render(array $collection)
|
2012-04-12 12:48:36 +02:00
|
|
|
{
|
|
|
|
return $collection;
|
|
|
|
}
|
2012-04-12 01:28:36 +02:00
|
|
|
}
|