Subversion-Projekte lars-tiefland.shop_ns

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?php

    /**
     * @author Lars Tiefland
     * @copyright 2012
     */

    namespace Weban;
    class hersteller
    {
        public function __construct( $id )
        {
            $sql = "SELECT
                    id,
                    name,
                    logo,
                    homepage
                FROM
                    hersteller
                WHERE
                    id = $id
            ";
            $res = $GLOBALS["db"]->query( $sql );
            $row = $res->fetchRow();
            $this->id = $row["id"];
            $this->name = $row["name"];
            $this->logo = $row["logo"];
            $this->homepage = $row["homepage"];
        }

        public static function Liste()
        {
            $sql = "SELECT
                    id
                FROM
                    hersteller
            ";
            $res = $GLOBALS["db"]->query( $sql );
            while ( $row = $res->fetchRow() )
            {
                $ret[] = new hersteller( $row["id"] );
            }
            return $ret;
        }
    }
?>