<?php


namespace AppBundle\Entity\Repositories;

use Doctrine\ORM\EntityRepository;

class DecaissementsRepository extends EntityRepository
{

    public function findDecaissementsBySiret($siret)
    {
        $sql ="SELECT * FROM `decaissement` AS d 
                WHERE d.interlocuteur_siret ='". $siret."'
                ORDER BY d.date_demande desc";

        $statement = $this->getEntityManager()->getConnection()->prepare($sql);
        $statement->execute();

        return $statement->fetchAll();
    }
}
