Skip to content

Instantly share code, notes, and snippets.

@colinhoernig
Created May 20, 2015 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colinhoernig/58ce4f076e860f24e941 to your computer and use it in GitHub Desktop.
Save colinhoernig/58ce4f076e860f24e941 to your computer and use it in GitHub Desktop.
Custom Fractal Serializer for use with Ember's ActiveModelAdapter
<?php
namespace MusicDealers\Serializers;
use League\Fractal\Serializer\JsonApiSerializer;
class EmberSerializer extends JsonApiSerializer {
/**
* Serialize an item resource
*
* @param string $resourceKey
* @param array $data
*
* @return array
*/
public function item($resourceKey, array $data)
{
return [$resourceKey => $data];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment