/**
  * @param array $data
  *
  * @return Track
  */
 private function buildEntity(array $data) : Track
 {
     $track = Track::instance($data['name'], Album::instance($data['album']['id'], $data['album']['title']));
     $track->setId($data['id']);
     $track->setGenre(Genre::instance($data['genre']['id'], $data['genre']['name']));
     $track->setMediaType(MediaType::instance($data['mediaType']['id'], $data['mediaType']['name']));
     $track->setComposer($data['composer']);
     return $track;
 }
 /**
  * @param MediaType $mediaType
  *
  * @return MediaTypeResource
  */
 public function transform(MediaType $mediaType)
 {
     return MediaTypeResource::instance($mediaType->id(), $mediaType->name());
 }