All pastes #154447 Raw Edit

Someone

public php v1 · immutable
#154447 ·published 2006-08-30 10:29 UTC
rendered paste body
<?phperror_reporting(E_ALL);/** * Die ProductDAO Klasse ist für die Produkte zuständig, ihre Methoden enthält * SQL- Statements bezüglich der Produkte und nutzt die Methoden „retrieve“ oder * ,bei einer Datenbankabfrage, der Klasse DAO. Als Methodenparameter werden * Statemnets übergeben. * * @author firstname and lastname of author, <author@example.org> */if (0 > version_compare(PHP_VERSION, '5')) {    die('This file was generated for PHP 5');}/** * Die abstrakte DAO Klasse arbeitet mit der Methode fetch() aus der Klasse Data * und abstrahiert die Methoden „retrieve(sql: string): object“ und „update(sql: * boolean“. Von DAO werden noch weitere problemabhängige Klassen abgeleitet * CartDAO,ProductDAO und CustomerDAO) in denen die SQL- Statements enthlaten * * @author Christoph Nagel */require_once('class.DAO.php');/** * In dieser Klasse werden die Modelle Search und Product abgebildet, sie greift * nötig auf die Data Access Schicht zu. * * @author Christoph Nagel */require_once('class.SearchService.php');/* user defined includes */// section .:0000000000000AB4-includes begin// section .:0000000000000AB4-includes end/* user defined constants */// section .:0000000000000AB4-constants begin// section .:0000000000000AB4-constants end/** * Die ProductDAO Klasse ist für die Produkte zuständig, ihre Methoden enthält * SQL- Statements bezüglich der Produkte und nutzt die Methoden „retrieve“ oder * ,bei einer Datenbankabfrage, der Klasse DAO. Als Methodenparameter werden * Statemnets übergeben. * * @access public * @author firstname and lastname of author, <author@example.org> */class ProductDAO    /* multiple generalisations not supported by PHP: */    /* extends DAO,            DAO */{    // --- ATTRIBUTES ---    /**     * Attribut der Klasse ProductDAO     *     * @access protected     * @var object     */    protected static $m_prductDAO = null;    // --- OPERATIONS ---    /**     * Liefert alle Produkte als Suchergebniss aus der Datenbank und übergibt     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @return object     */    public function finAll()    {        $returnValue = null;        // section .:0000000000000A9C begin        $sql="SELECT * FROM Artikel";        $returnValue = $this->retrieve($sql);        // section .:0000000000000A9C end        return $returnValue;    }    /**     * Sucht nach Produkten, deren Beschreibung eingegeben wurde in der     * und übergibt sie     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @param string     * @return object     */    public function searchByDescription($description)    {        $returnValue = null;        // section .:0000000000000AA0 begin        $sql="SELECT * FROM Artikel";	        $returnValue = $this->retrieve($sql);        // section .:0000000000000AA0 end        return $returnValue;    }    /**     * Sucht nach Produkten, die dem eingegebenen Preis entsprechen in der     * und übergibt sie     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @param float     * @return object     */    public function searchByPrice($price)    {        $returnValue = null;        // section .:0000000000000AA4 begin        $sql="SELECT * FROM Artikel WHERE Preis <= $price";        $returnValue = $this->retrieve($sql);        // section .:0000000000000AA4 end        return $returnValue;    }    /**     * Sucht nach Produkten in der Datenbank, die sich in einer eingegebenen     * befinden und übergibt sie     *     * @access public     * @author Christoph Nagel     * @param string     * @return object     */    public function searchByCategory($category)    {        $returnValue = null;        // section .:0000000000000AA9 begin         $sql="SELECT * FROM Artikel WHERE Kategorie <= $category";        $returnValue = $this->retrieve($sql);        // section .:0000000000000AA9 end        return $returnValue;    }    /**     * Sucht ein Produkt in der Datenbank direkt über die ID und übergibt sie     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @param int     * @return object     */    public function searchByID($ID)    {        $returnValue = null;        // section .:0000000000000AAD begin        // section .:0000000000000AAD end        return $returnValue;    }    /**     * Erzeugt einen Standart Konstruktor     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @return void     */    public function __constuct()    {        // section .:0000000000000AB0 begin         parent::__construct();        // section .:0000000000000AB0 end    }    /**     * Erzeugt eine Instanz der Klasse ProductDAO     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @return void     */    public static function getInstance()    {        // section .:0000000000000AB3 begin        if (!isset (self :: $m_productDAO))			self :: $m_productDAO = new ProductDAO();        // section .:0000000000000AB3 end    }} /* end of class ProductDAO */?>