<?php

namespace Models;

use Core\Model;

class Revision extends Model
{
    protected static $table = 'revisions';

    public static function getForObject($objectId, $objectType)
    {
        $stmt = self::$pdo->prepare("SELECT * FROM " . self::$table . " WHERE object_id = ? AND object_type = ? ORDER BY created_at DESC");
        $stmt->execute([$objectId, $objectType]);
        return $stmt->fetchAll();
    }
}
