public function index($contentType)
    {
        $pets = PetFactory::instance()->getAll();

        $transformer = new ResourceTransformer();
        $context = $this->getContext(Action::INDEX);

        $resources = $transformer->toResources(PetDefinition::class, $pets, $context);
        $this->outputResources($resources, $contentType);
    }
public function index($contentType)
    {
        $pets = PetFactory::instance()->getAll();

        $transformer = new ResourceTransformer();
        $context = $this->getContext(Action::INDEX);

        $resources = $transformer->toResources(PetDefinition::class, $pets, $context);
        $this->outputResources($resources, $contentType);
    }
public function index ( $ contentType ) { $ pets = PetFactory :: instance ( ) -> getAll ( ) ; $ transformer = new ResourceTransformer ( ) ; $ context = $ this -> getContext ( Action :: INDEX ) ; $ resources = $ transformer -> toResources ( PetDefinition :: class , $ pets , $ context ) ; $ this -> outputResources ( $ resources , $ contentType ) ; }
Get an index of all pets.
Get an index of all pets .