<?php
class Tarif {
    private $conn;
    private $table_name = "tarifs";

    public function __construct($db) {
        $this->conn = $db;
    }

    public function getByType($type) {
        $query = "SELECT * FROM " . $this->table_name . " WHERE type = ?";
        $stmt = $this->conn->prepare($query);
        $stmt->bindParam(1, $type);
        $stmt->execute();
        return $stmt;
    }
}
?>