Subversion-Projekte lars-tiefland.shop_ns

Revision

Revision 18 | Revision 22 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 18 Revision 20
Zeile 13... Zeile 13...
13
     * @version $Id$
13
     * @version $Id$
14
     */
14
     */
15
    namespace Weban;
15
    namespace Weban;
16
    class directory
16
    class directory
17
    {
17
    {
18
        private $id;
18
        public $id;
19
        public $name;
19
        public $name;
20
        private $description;
20
        public $description;
21
        public $link;
21
        public $link;
22
        public $artikelstamm;
22
        public $artikelstamm;
-
 
23
        public $bilder;
Zeile 23... Zeile 24...
23
 
24
 
24
        public function __construct( $id = null )
25
        public function __construct( $id = null )
25
        {
26
        {
26
            $sql = "SELECT
27
            $sql = "SELECT
Zeile 43... Zeile 44...
43
            $this->link = "/index.php?navigation=" . $this->id;
44
            $this->link = "/index.php?navigation=" . $this->id;
44
            $this->bilder = directory_bild::Liste( $this->id );
45
            $this->bilder = directory_bild::Liste( $this->id );
45
            $this->artikelstamm = $row["artikelstamm"];
46
            $this->artikelstamm = $row["artikelstamm"];
46
        }
47
        }
Zeile 47... Zeile -...
47
 
-
 
48
        public function __set( $name, $value )
-
 
49
        {
-
 
50
            $allowed = array(
-
 
51
                "name" => "setName",
-
 
52
                "status" => "setStatus",
-
 
53
                "description" => "setDesc",
-
 
54
                );
-
 
55
            if ( isset( $allowed[$name] ) )
-
 
56
            {
-
 
57
                trigger_error( "Please use " . $allowed[$name] . "() instead!",
-
 
58
                    E_USER_DEPRECATED );
-
 
59
                $this->{$allowed[$name]}( $value );
-
 
60
            }
-
 
61
            else
-
 
62
            {
-
 
63
                trigger_error( 'Undefined property: ' . get_class( $this ) .
-
 
64
                    '::$' . $name, E_USER_NOTICE );
-
 
65
            }
-
 
66
        }
-
 
67
 
-
 
68
        public function __get( $name )
-
 
69
        {
-
 
70
            $allowed = array(
-
 
71
                "id" => "getId",
-
 
72
                "name" => "getName",
-
 
73
                "status" => "getStatus",
-
 
74
                "description" => "getDesc",
-
 
75
                );
-
 
76
            if ( isset( $allowed[$name] ) )
-
 
77
            {
-
 
78
                $this->{$allowed[$name]}();
-
 
79
            }
-
 
80
            else
-
 
81
            {
-
 
82
                trigger_error( 'Undefined property: ' . get_class( $this ) .
-
 
83
                    '::$' . $name, E_USER_NOTICE );
-
 
84
            }
-
 
85
        }
-
 
86
 
-
 
87
        public function getId()
-
 
88
        {
-
 
89
            return $this->id;
-
 
90
        }
-
 
91
        public function getName()
-
 
92
        {
-
 
93
            return $this->name;
-
 
94
        }
-
 
95
        public function getDest()
-
 
96
        {
-
 
97
            return $this->description;
-
 
98
        }
-
 
99
        public function setDesc( $value )
-
 
100
        {
-
 
101
            $this->description = $value;
-
 
102
        }
-
 
103
        public function setName( $value )
-
 
104
        {
-
 
105
            $this->name = $value;
-
 
106
        }
48
 
107
        public static function Liste( $father )
49
        public static function Liste( $father, $order="kennung" )
108
        {
50
        {
109
            $items = array();
51
            $items = array();
110
            $sql = "SELECT
52
            $sql = "SELECT
111
                    id
53
                    id
Zeile 114... Zeile 56...
114
                WHERE
56
                WHERE
115
                    father = $father
57
                    father = $father
116
                AND
58
                AND
117
                    status = 0
59
                    status = 0
118
                AND
60
                AND
-
 
61
                    artikelstamm=0
-
 
62
                AND
119
                    language='" . $GLOBALS["INI"]["language"] . "'
63
                    language='" . $GLOBALS["INI"]["language"] . "'
-
 
64
                ORDER BY
-
 
65
                    $order
120
            ";
66
            ";
121
            $res = $GLOBALS["db"]->query( $sql );
67
            $res = $GLOBALS["db"]->query( $sql );
122
            while ( $row = $res->fetchRow() )
68
            while ( $row = $res->fetchRow() )
123
            {
69
            {
124
                $items[] = new directory( $row["id"] );
70
                $items[] = new directory( $row["id"] );