The active column in the database only contains a boolean. The country column contains ISO 3166 A2 codes (2 char). Do you have any advice on improving this class?
<?php
class WebShops {
private $database;
public function __construct() {
$this->database = new Database();
}
public function fetchAll() {
$this->database->query("SELECT * FROM web_shops");
return $this->database->fetchAll();
}
public function fetchActive($option) {
$this->database->query("SELECT * FROM web_shops WHERE active = :option");
$this->database->bind(':option', $option);
return $this->database->fetchAll();
}
public function fetchCountry($country) {
$this->database->query("SELECT * FROM web_shops WHERE country = :country");
$this->database->bind(':country', $country);
return $this->database->fetchAll();
}
}