<commit_before><?php
class Pdo_Loan extends Pdo_Manager {
    
    public function add_loan($loan){
        $query = $this->pdo->prepare('INSERT INTO loans(customer, begindate, enddate, reason) VALUES (:customer, :begindate, :enddate, :resaon)');
        $query->bindValue(':customer', $loan->getCustomer());
        $query->bindValue(':begindate', $loan->getBegindate());
        $query->bindValue(':enddate', $loan->getEnddate());
        $query->bindValue(':reason', $loan->getReason());
        $query->execute();
        return $this->pdo->lastInsertId();
    }

    public function edit_loan($loan){
        $query = $this->pdo->prepare('UPDATE loans SET customer = :customer, begindate = :begindate, enddate = :enddate, reason = :reason WHERE id = :id');
        $query->bindValue(':id', $loan->getId());
        $query->bindValue(':customer', $loan->getCustomer());
        $query->bindValue(':begindate', $loan->getBegindate());
        $query->bindValue(':enddate', $loan->getEnddate());
        $query->bindValue(':reason', $loan->getReason());
        $query->execute();
    }<commit_msg>Utilisation du helper pour convertir la date au format MySQL<commit_after><?php
class Pdo_Loan extends Pdo_Manager {
    
    public function add_loan($loan){
        $query = $this->pdo->prepare('INSERT INTO loans(customer, begindate, enddate, reason) VALUES (:customer, :begindate, :enddate, :resaon)');
        $query->bindValue(':customer', $loan->getCustomer());
        $query->bindValue(':begindate', Helper_Date::timestampToMysql($loan->getBegindate()));
        $query->bindValue(':enddate', Helper_Date::timestampToMysql($loan->getEnddate()));
        $query->bindValue(':reason', $loan->getReason());
        $query->execute();
        return $this->pdo->lastInsertId();
    }

    public function edit_loan($loan){
        $query = $this->pdo->prepare('UPDATE loans SET customer = :customer, begindate = :begindate, enddate = :enddate, reason = :reason WHERE id = :id');
        $query->bindValue(':id', $loan->getId());
        $query->bindValue(':customer', $loan->getCustomer());
        $query->bindValue(':begindate', Helper_Date::timestampToMysql($loan->getBegindate()));
        $query->bindValue(':enddate', Helper_Date::timestampToMysql($loan->getEnddate()));
        $query->bindValue(':reason', $loan->getReason());
        $query->execute();
    }
{'fraction_non_alphanumeric': 0.19401096583719948, 'fraction_numerical': 0.0, 'mean_word_length': 4.068376068376068, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3275415', 'n_tokens_mistral': 767, 'n_tokens_neox': 730, 'n_words': 129}