Created
May 20, 2015 20:15
-
-
Save colinhoernig/58ce4f076e860f24e941 to your computer and use it in GitHub Desktop.
Custom Fractal Serializer for use with Ember's ActiveModelAdapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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