<?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 StrankyModel extends Repository {
    
    
    
    public function getStrankaByUrl($url) {
            return $this->connection->table('stranky')
            ->where('url',$url)->fetch();
    }
    
    public function getStrankaById($id) {
            return $this->connection->table('stranky')
            ->where('id',$id)->fetch();
    }
    
    public function updateStranka($id, $data) {
    $this->connection->table('stranky')
        ->where('id = ?', $id)
        ->update($data);
    }

    public function deleteStranka($id) {
        $this->connection->table('stranky')
            ->where('id = ?', $id)
            ->delete();
    }
    
}

