Changed model structure
This commit is contained in:
@@ -34,24 +34,4 @@ class Post extends \Core\Model
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function showCategories()
|
||||
{
|
||||
try {
|
||||
$db = static::connectDB();
|
||||
|
||||
$sql = "SELECT * FROM kategori";
|
||||
|
||||
$query = $db->prepare($sql);
|
||||
|
||||
if ($query->execute()) {
|
||||
if ($query->rowCount() > 1) {
|
||||
$results = $query->fetchAll(\PDO::FETCH_ASSOC);
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
throw new \Exception($e->getMessage(), 444);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user