<?php
class DefaultRabais {

    public static function getAll() {
        $query = "SELECT * FROM defaultrabais ORDER BY CodeRabais";
        $statement = Connection::getStatement($query);
        $statement->execute();
        return $statement->fetchAll();
    }

    public static function getByCodeRabais($codeRabais) {
        $query = "SELECT * FROM defaultrabais WHERE CodeRabais=:code";
        $statement = Connection::getStatement($query);
        $statement->bindParam(":code", $codeRabais);
        $statement->execute();
        return $statement->fetch();
    }
}