TestTransformer.php 527 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Mpociot\ApiDoc\Tests\Fixtures;
  3. use League\Fractal\TransformerAbstract;
  4. /**
  5. * A test transformer to show the functions.
  6. *
  7. * @author Tobias van Beek <t.vanbeek@tjvb.nl>
  8. */
  9. class TestTransformer extends TransformerAbstract
  10. {
  11. /**
  12. * A Fractal transformer.
  13. *
  14. * @return array
  15. */
  16. public function transform(TestModel $model)
  17. {
  18. return [
  19. 'id' => $model->id,
  20. 'description' => $model->description,
  21. 'name' => $model->name,
  22. ];
  23. }
  24. }