<?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 OznameniModel extends Repository {
    
    public function getOznameni() {
            return $this->connection->table('oznameni');
    }
    
    public function getOznameniById($id) {
    return $this->connection->table('oznameni')
                    ->where('id = ?', $id)
                    ->fetch();
    }
    
    public function updateOznameni($id, $data) {
    $this->connection->table('oznameni')
        ->where('id = ?', $id)
        ->update($data);
    }

    public function deleteOznameni($id) {
        $this->connection->table('oznameni')
            ->where('id = ?', $id)
            ->delete();
    }
    
    public function addOznameni($data) {
    $this->connection->table('oznameni')
        ->insert($data);
    }
    
    
}

