Skip to content
Snippets Groups Projects
Commit eebef9f7 authored by egijago's avatar egijago
Browse files

style: match code convention

parent 65eb8c0a
2 merge requests!7refactor: change relative path to absolute,!5Unfinished search
...@@ -8,13 +8,13 @@ Class GenreModel { ...@@ -8,13 +8,13 @@ Class GenreModel {
public function __construct() public function __construct()
{ {
$this->db = new Database(); $this->db = new Database();
} }
public function getAllGenre() public function getAllGenre()
{ {
$this->db->query('SELECT * FROM ' . $this->table); $this->db->query('SELECT * FROM ' . $this->table);
return $this->db->resultSet(); return $this->db->resultSet();
} }
public function getGenreByGenreID($id) public function getGenreByGenreID($id)
...@@ -35,7 +35,8 @@ Class GenreModel { ...@@ -35,7 +35,8 @@ Class GenreModel {
return $this->db->rowCount(); return $this->db->rowCount();
} }
public function insertGenre($name, $image_url, $color) { public function insertGenre($name, $image_url, $color)
{
$this->db->query('INSERT INTO ' . $this->table . ' (name, image_url, color) VALUES (:name, :image_url, :color)'); $this->db->query('INSERT INTO ' . $this->table . ' (name, image_url, color) VALUES (:name, :image_url, :color)');
$this->db->bind('name', $name); $this->db->bind('name', $name);
$this->db->bind('image_url', $image_url); $this->db->bind('image_url', $image_url);
...@@ -44,7 +45,8 @@ Class GenreModel { ...@@ -44,7 +45,8 @@ Class GenreModel {
return $this->db->rowCount(); return $this->db->rowCount();
} }
public function deleteGenre($id){ public function deleteGenre($id)
{
$this->db->query('DELETE FROM ' . $this->table . ' WHERE id_genre = :id'); $this->db->query('DELETE FROM ' . $this->table . ' WHERE id_genre = :id');
$this->db->bind('id', $id); $this->db->bind('id', $id);
$this->db->execute(); $this->db->execute();
......
<?php <?php
include(__DIR__ ."/../db/Database.class.php"); include(__DIR__ ."/../db/Database.class.php");
use Database; use Database;
class Auth { class UsersModel {
private $table = 'users'; private $table = 'users';
private $db; private $db;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment