All pastes #157090 Raw Edit

Unnamed

public php v1 · immutable
·published 2006-09-01 08:18 UTC
rendered paste body
<?phperror_reporting(E_ALL);/** * 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&#65533;gige Klassen abgeleitet * CartDAO,ProductDAO und CustomerDAO) in denen die SQL- Statements enthlaten * * @author Christoph Nagel */if (0 > version_compare(PHP_VERSION, '5')) {    die('This file was generated for PHP 5');}/** * Die Abstrakte Klasse Data Access ist fr den Datenbank Aufruf zust&#65533;dig. Mit * Methode getInstance(): object wird eine Referenz auf dieses Data Access * zurckgegeben. Mit der Methode fetch(): object wird das Ergebnis einer * zurckgegeben. Beide Methoden mssen von den Klassen MySQL Data Access oder * Data Access implementiert werden. * * @author firstname and lastname of author, <author@example.org> */require_once('class.DataAccess.php');/* user defined includes */// section .:0000000000000A55-includes begin// section .:0000000000000A55-includes end/* user defined constants */// section .:0000000000000A55-constants begin// section .:0000000000000A55-constants end/** * 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&#65533;gige Klassen abgeleitet * CartDAO,ProductDAO und CustomerDAO) in denen die SQL- Statements enthlaten * * @abstract * @access public * @author Christoph Nagel */abstract class DAO{    // --- ATTRIBUTES ---    /**     * Short description of attribute m_dataAccess     *     * @access protected     * @var DataAccess     */    protected $m_dataAccess = null;    // --- OPERATIONS ---    /**     * Stellt eine SQL Abfrage     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @param string     * @return DataAccessResult     */    public function retrieve($sql)    {        $returnValue = null;        // section .:0000000000000A4D begin                  $returnValue = $this->m_dataAccess->fetch($sql);		if ($error = $returnValue->isError())            trigger_error($error);			        // section .:0000000000000A4D end        return $returnValue;    }    /**     * Macht ein Update auf die Datenbank     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @param string     * @return boolean     */    public function update($sql)    {        $returnValue = (bool) false;        // section .:0000000000000A51 begin                $returnValue = retrieve($sql);		        // section .:0000000000000A51 end        return (bool) $returnValue;    }    /**     * Erzeugt einen Standart Konstuktor     *     * @access public     * @author firstname and lastname of author, <author@example.org>     * @return void     */    public function __constuct()    {        // section .:0000000000000A54 begin		 $this->m_dataAccess = DataAccess::getInstance();		         // section .:0000000000000A54 end    }} /* end of abstract class DAO */?>