<?php

namespace Market\ZodacoBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * UsersRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class UsersRepository extends EntityRepository
{

    public function _getUserlist() {
        $q = 'SELECT c FROM MarketZodacoBundle:Users c ';
        $q .= ' ORDER BY c.id ASC';
        return $this->getEntityManager()
                        ->createQuery($q)
                        ->getResult();
    }
    
    public function updateUser($param, $total, $id) {
        $q = "UPDATE MarketZodacoBundle:Users c  SET $param = $param + $total WHERE c.id = $id";
        $this->getEntityManager()->createQuery($q)->execute();
    }
}
