<?php
class GroupeUsersFonction {
    public static function getByNoGroupUserAndNoGroup($noGroupUser, $noGroup) {
        $query = "SELECT * FROM groupeusersfonction WHERE NoGroupeUsers=:nogroupuser AND NoGroupe=:nogroup";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":nogroupuser", $noGroupUser);
        $statement->bindParam(":nogroup", $noGroup);
        $statement->execute();
        return $statement->fetch();
    }

    public static function getByNoGroupUserAndNoGroupAndNoFonction($noGroupUser, $noGroup, $noFonction) {
        $query = "SELECT * FROM groupeusersfonction WHERE NoGroupeUsers=:nogroupuser AND NoGroupe=:nogroup AND NoFonction=:nofonction";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":nogroupuser", $noGroupUser);
        $statement->bindParam(":nogroup", $noGroup);
        $statement->bindParam(":nofonction", $noFonction);
        $statement->execute();
        return $statement->fetch();
    }
}