<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

abstract class sitemap {

    protected $map = array();
    protected $module_name = 'example';
    protected $changefreq = 'weekly';
    protected $priority = '0.5';

    public function get_mudule_map() {

        return (array) $this->map;
    }

}

class sitemap_item {

    protected $data = array();

    // set data

    public function add_loc($loc) {
        $this->data['loc'] = $loc;
    }

    public function add_lastmod($lastmod) {
        $this->data['lastmod'] = $lastmod;
    }

    public function add_changefreq($changefreq) {
        $this->data['changefreq'] = $changefreq;
    }

    public function add_priority($priority) {
        $this->data['priority'] = $priority;
    }

    //get data

    public function get_loc() {
        return $this->data['loc'];
    }

    public function get_lastmod() {
        return $this->data['lastmod'];
    }

    public function get_changefreq() {
        return $this->data['changefreq'];
    }

    public function get_priority() {
        return $this->data['priority'];
    }

    public function __construct($loc = '', $lastmod = '', $changefreq = '', $priority = '') {
        $this->add_loc($loc);
        $this->add_lastmod($lastmod);
        $this->add_changefreq($changefreq);
        $this->add_priority($priority);
    }

}