<?php

namespace App\Models;

use CodeIgniter\Model;

class EvenementModel extends Model
{
    protected $table = 'evenement';
    protected $primaryKey = 'id_evenement';

    protected $allowedFields = [
        'libelle',
        'date_debut',
        'date_fin',
        'description',
        'image'
    ];

    public function rechercheEvent($info)
{
    return $this->select('*')
                ->groupStart()
                    ->like('libelle', $info)
                    ->orLike('description', $info)
                ->groupEnd()
                ->findAll();
}

    
}
