Subversion-Projekte lars-tiefland.ci

Revision

Revision 1836 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1809 lars 1
<?php
2
 
3
/**
4
 *
5
 * @package WebanOS CI
6
 * @author Lars Tiefland <ltiefland@gmail.com>
7
 * @copyright 2016
8
 * @version $Rev: 1880 $
9
 */
10
 
1810 lars 11
/**
12
 * Auspraegung_model
13
 *
14
 * @package WebanOS CI
15
 * @author Lars Tiefland
16
 * @copyright 2016
17
 * @version $Id: Auspraegung_model.php 1880 2016-12-22 18:06:12Z lars $
18
 * @access public
19
 */
1809 lars 20
class Auspraegung_model extends CI_Model
21
{
1810 lars 22
	/**
23
	 * Auspraegung_model::__construct()
24
	 *
25
	 * @return
26
	 */
1809 lars 27
	public function __construct()
28
	{
29
		parent::__construct();
30
	}
31
 
1810 lars 32
	/**
33
	 * Auspraegung_model::get_list()
34
	 *
35
	 * @return
36
	 */
1809 lars 37
	public function get_list()
38
	{
39
		$sql = "SELECT
40
				id
41
			FROM
42
				auspraegung
43
		";
44
		$res = $this->db->query($sql);
1810 lars 45
		$rows = array();
1809 lars 46
		while ($row = $res->unbuffered_row('array'))
47
		{
48
			$row = $this->get($row["id"]);
1836 lars 49
			$rows[] = $row;
1809 lars 50
		}
1810 lars 51
		return $rows;
1809 lars 52
	}
53
 
1810 lars 54
	/**
55
	 * Auspraegung_model::get()
56
	 *
57
	 * @param mixed $id
58
	 * @return
59
	 */
1826 lars 60
	public function get($id)
1809 lars 61
	{
62
		$sql = "SELECT
1880 lars 63
				a.*,
64
				at.name AS typ
1809 lars 65
			FROM
1880 lars 66
				auspraegung a
67
			JOIN
68
				auspraegung_typ at
69
			ON
70
				at.id=a.type
1809 lars 71
			WHERE
1880 lars 72
				a.id=".$id."
1809 lars 73
		";
74
		$res = $this->db->query($sql);
1827 lars 75
		$row = $res->unbuffered_row('array');
1809 lars 76
		return $row;
77
	}
78
}
79
 
80
?>