<?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 DkkModel extends Repository {
    
    public function getPsi() {
            return $this->connection->table('dkk')
            ->where('fena = ?', 0);
    }
    
    public function getFeny() {
            return $this->connection->table('dkk')
            ->where('fena',1);
    }
    
    public function getPes($id) {
            return $this->connection->table('dkk')
            ->where('id',$id)->fetch();
    }
    
    public function updatePes($id, $data) {
    $this->connection->table('dkk')
        ->where('id = ?', $id)
        ->update($data);
    }

    public function deletePes($id) {
        $this->connection->table('dkk')
            ->where('id = ?', $id)
            ->delete();
    }
    
    public function addPes($data) {
    $this->connection->table('dkk')
        ->insert($data);
    }
    
    
}

