<?php
class Module extends MY_Model
{
	const DB_TABLE = 'modules';
    const DB_TABLE_PK = 'module_id';

    function search($q)
	{
		if($q == null)
		{
			return array();
		}

		$q = $this->db->escape_str($q);

		$query = $this->db->query("SELECT *
		                          FROM modules
		                          WHERE
			                          `name` LIKE '%$q%'
		                          ORDER BY `name`");

		return $query->result();
	}
}
