<?php
namespace App\Models;

use App\Core\Model;

class Currency extends Model
{
    public function getAll()
    {
        $stmt = $this->query("SELECT * FROM currencies ORDER BY code");
        return $stmt->fetchAll();
    }

    public function find($id)
    {
        $stmt = $this->query("SELECT * FROM currencies WHERE id = ?", [$id]);
        return $stmt->fetch();
    }
}