Subversion-Projekte lars-tiefland.ci

Revision

Revision 1812 | Zur aktuellen Revision | Details | 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: 1811 $
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 1811 2016-12-15 19:27:51Z 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
43
		";
44
		$res = $this->db->query($sql);
45
		$rows = array();
46
		while ($row = $res->unbuffered_row('array'))
47
		{
48
			$row = $this->get($row["id"]);
49
			$rows[]=$row;
50
		}
51
		return $rows;
52
	}
53
 
54
	/**
55
	 * Auspraegung_model::get()
56
	 *
57
	 * @param mixed $id
58
	 * @return
59
	 */
60
	private function get($id)
61
	{
62
		$sql = "SELECT
63
				ata.*
64
			FROM
65
				artikel_to_auspraegung ata
66
			JOIN
67
				auspraegung a
68
			ON
69
				a.id=ata.auspraegung
70
			WHERE
71
				id=".$id."
72
		";
73
		$res = $this->db->query($sql);
74
		$row = $res->unbuffered_row($row);
75
		return $row;
76
	}
77
}
78
 
79
?>