Subversion-Projekte lars-tiefland.ci

Revision

Revision 1815 | Revision 1818 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

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