<?PHP
class elements_SQL extends SqlRequest{

	var $table = 'elements';

	function elements($add_sql = '', $execute = false, $cache = false){

		$this->LINE = __FILE__.' '.__LINE__;
		return $this->Select(
			"SELECT p1.*, GROUP_CONCAT(p3.name) AS access FROM elements AS p1 ".
			"LEFT JOIN permissions AS p2 ON p2.table_name = 'elements' AND table_id = p1.id ".
			"LEFT JOIN roles AS p3 ON p3.id = p2.role_id ".
			"GROUP BY p1.name ".
		$add_sql,
		$execute,
		$cache
		);
	}
}
?>