<?php
    class Homepage {
        public function __construct(Database $db) {
            $this->db = $db;
        }

        public function getSections() {
            $sections = array();
            $stmt = $this->db->query("SELECT * FROM {$this->db->prefix}home_sections");
            if($stmt->num_rows > 0) {
                $sections = $stmt->rows;
            }
            return $sections;
        }
        
        public function deleteSection($id = 0) {
            $this->db->query("DELETE FROM {$this->db->prefix}home_sections WHERE id=:id", array(':id'=>$id));
        }
    }