Skip to content

Instantly share code, notes, and snippets.

View alexcesaro's full-sized avatar

Alexandre Cesaro alexcesaro

  • Le Bon Coin
  • Paris
View GitHub Profile
@alexcesaro
alexcesaro / UseIndexWalker.php
Last active August 17, 2017 14:12 — forked from arnaud-lb/UseIndexWalker.php
USE INDEX / FORCE INDEX in a Doctrine2 DQL query (with support for multiple tables in the FROM clause).
<?php
use Doctrine\ORM\Query\SqlWalker;
class UseIndexWalker extends SqlWalker
{
const HINT_USE_INDEX = 'UseIndexWalker.UseIndex';
public function walkFromClause($fromClause)
{