<?php
    /**
     * Page superclass file.
     *
     * Provides a class with all the properties and methods to display the page.
     *
     * @category Page
     */

    /**
     * Page superclass.
     *
     * Every visitable page type must inherit from this one.
     *
     * @category Page
     */
    abstract class Page{

        /**
         * @var resource Database connection.
         */
        public $db;

        /**
         * @var string Path to the view associated with the page.
         */
        public $view;

        /**
         * @var string Title of the page, in the defined language.
         */
        public $title;

        /**
         * @var string Site name.
         */
        public $name;

        /**
         * @var string Page description, in the defined language.
         */
        public $description;

        /**
         * @var string URL to the site favicon.
         */
        public $favicon;

        /**
         * @var string URL to the page icon or main image.
         */
        public $icon;

        /**
         * @var string Canonical URL.
         */
        public $canonical;

        /**
         * @var string Autjhor URL.
         */
        public $author;

        /**
         * @var mixed[] The filters the page can handle.
         *
         * @see FILTER::CATALOG
         */
        public $filters;

        /**
         * Constructor.
         *
         * @param resource $db Connection to the database.
         */
        public function __construct($db){
            $this->db = $db;
            $this->favicon = URL::IMG["LOGO"] . "sw.png";
            $this->icon = URL::IMG["LOGO"] . "sw.png";
            $this->name = "SWDB";
            $this->author = URL::BASE;
        }
        /**
         * Parses the request looking for the selected filters, validates them
         * and adds them to the $filters array.
         *
         * Must be overriden in the page classes.
         */
        private function parse_filters(){}
    }
?>

