Skip to content

Instantly share code, notes, and snippets.

@piotrpasich
Created December 1, 2013 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotrpasich/7734387 to your computer and use it in GitHub Desktop.
Save piotrpasich/7734387 to your computer and use it in GitHub Desktop.
<?php
class AdController extends Controller
{
/**
* @Route("/ad", name="ad")
*/
public function indexAction(Request $request)
{
$criterias = $this->get('advertisement.criterias')->resolveRequest($request);
$advertisement = $this->get('advertisement.manager')->getByCriterias($criterias);
//There the problem with performance might occur
$this->getDoctrine()->getRepository('XsolveAdverisementBundle:Advertisement')->saveStatistics($request, $advertisement);
return new Response(
$advertisement->getImage(),
200
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment