<?php
namespace App\Models;

class StudentRepository extends BaseRepository {
    public function find(int $id): ?array {
        return $this->fetchOne("SELECT s.*, u.first_name, u.last_name, u.email FROM students s JOIN users u ON s.user_id = u.id WHERE s.id = ?", [$id]);
    }

    public function findByNumber(string $studentNumber): ?array {
        return $this->fetchOne("SELECT * FROM students WHERE student_number = ?", [$studentNumber]);
    }
}
