<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

class DokumentyModel extends Repository {
    
    public function getDokumenty($stranka) {
            return $this->connection->table('dokumenty')
            ->where('stranka = ?', $stranka);
                   // ->fetch();
    }
    
    public function getDokumentById($id) {
            return $this->connection->table('dokumenty')
            ->where('id = ?', $id)->fetch();
    }
    
  

    public function deleteDokument($id) {
        $this->connection->table('dokumenty')
            ->where('id = ?', $id)
            ->delete();
    }
    public function updateDokument($id, $data) {
    $this->connection->table('dokumenty')
        ->where('id = ?', $id)
        ->update($data);
    }
    
    
    public function addDokument($data) {
    $this->connection->table('dokumenty')
        ->insert($data);
    }
    

}

