db = db(); } public function all() { $stmt = $this->db->query("SELECT * FROM {$this->table}"); return $stmt->fetchAll(); } public function find($id) { $stmt = $this->db->prepare("SELECT * FROM {$this->table} WHERE id = :id"); $stmt->execute(['id' => $id]); return $stmt->fetch(); } public function where($column, $value) { $stmt = $this->db->prepare("SELECT * FROM {$this->table} WHERE {$column} = :value"); $stmt->execute(['value' => $value]); return $stmt->fetchAll(); } }