<?php
class BillingPeriod
{
    private $conn;
    private $table_name = "billing_periods";

    public $id;
    public $name; // e.g., 'Monthly', 'Yearly'
    public $duration_days;

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

    public function readAll()
    {
        $query = "SELECT * FROM " . $this->table_name;
        $stmt = $this->conn->prepare($query);
        $stmt->execute();
        return $stmt;
    }
}
?>