<?php

/*
 * Model's functions of Covid Entity
 */

/**
 * @author Messanga Landry <messangalandry@gmail.com>
 */

include APPLICATION_PATH . '/Models/Covid.php';

class CovidDAO {
    //put your code here
    public $_em;
    function CovidDAO(){
        $registry = Zend_Registry::getInstance();
        $this->_em = $registry->entitymanager;
    }
    
//    /**
//     * 
//     * @param Application\Models\Covid $covid
//     */
//    public function enregistrer($covid){
//        $this->_em->persist($covid);
//        $this->_em->flush();
//        
//    }
    
    /**
     * 
     * @param Application\Models\Covid $covid
     */
    public function editer($covid){
        $this->_em->merge($covid);
        $this->_em->flush();
    }
    
//    /**
//     * 
//     * @param Application\Models\Covid $covid
//     */
//    public function disable($covid){
//        $this->_em->remove($covid);
//        $this->_em->flush();
//    }
    
    /**
     * 
     * 
     * @return Application\Models\Covid $covid
     */
    public function getCovid($identifiant){
        $covid = $this->_em->getRepository('\Application\Models\Covid')->findOneBy(array('grippeNumInclusion'=>$identifiant));
        return $covid;
    }
    
   
}
