src/ModelController.php
public function getSerializer(Request $req)
    {
        $modelSerializer = new ModelSerializer($req);
        $jsonSerializer = new JsonSerializer($req);

        $serializer = new ChainedSerializer();
        $serializer->add($modelSerializer)
                   ->add($jsonSerializer);

        return $serializer;
    }
public function getSerializer(Request $req)
    {
        $modelSerializer = new ModelSerializer($req);
        $jsonSerializer = new JsonSerializer($req);

        $serializer = new ChainedSerializer();
        $serializer->add($modelSerializer)
                   ->add($jsonSerializer);

        return $serializer;
    }
public function getSerializer ( Request $ req ) { $ modelSerializer = new ModelSerializer ( $ req ) ; $ jsonSerializer = new JsonSerializer ( $ req ) ; $ serializer = new ChainedSerializer ( ) ; $ serializer -> add ( $ modelSerializer ) -> add ( $ jsonSerializer ) ; return $ serializer ; }
Builds a serializer object.

@param Request $req

@return ChainedSerializer
Builds a serializer object .