<?php
class ModelSettingExtension extends Model {
	public function getExtensions($type,$subtype=null) {
        $sql = "SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "'";
        if ($subtype != null){
            $sql .= " and `subtype`=".$subtype;
        }
		$query = $this->db->query($sql);

		return $query->rows;
	}

  function getExtensionsByName($type, $name) {

    $this->load->type('tipocomum');

    $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "extension WHERE `type` = '" . $this->db->escape($type) . "' and `code` = '".$this->db->escape($name)."'");

    return $query->row;
  }


}
