<?php
class ModelExtensionEvent extends Model {
	function getEvents() {
		/*
		$query = $this->db->query("SELECT * FROM ps_event WHERE `trigger` LIKE 'catalog/%' AND status = '1' ORDER BY `event_id` ASC");

		return $query->rows;
		*/

		if($this->cache->cache_get('events'))
		return $this->cache->cache_get('events');

		$query = $this->db->query("SELECT * FROM ps_event WHERE `trigger` LIKE 'catalog/%' AND status = '1' ORDER BY `event_id` ASC");
		$this->cache->cache_set('events', $query->rows);
		
		return $query->rows;
	}
}