openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 70578a7b18acbc3bc88cc518d7a09d93a2a654b9
parent 35944a561fa3853a6db7309bb32a8fc52b475110
Author: dankert <devnull@localhost>
Date:   Mon, 22 Feb 2010 00:21:54 +0100

Fehlermeldung vermeiden, wenn Element nicht geladen werden kann.

Diffstat:
objectClasses/Element.class.php | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/objectClasses/Element.class.php b/objectClasses/Element.class.php @@ -175,16 +175,17 @@ class Element */ function load() { - $db = db_connection(); - if ( intval($this->elementid) != 0 ) { - $sql = new Sql( 'SELECT * FROM {t_element}'. - ' WHERE id={elementid}' ); + $db = db_connection(); + $sql = new Sql( <<<SQL +SELECT * FROM {t_element} + WHERE id={elementid} +SQL +); $sql->setInt( 'elementid',$this->elementid ); + $this->setDatabaseRow( $db->getRow( $sql ) ); } - - $this->setDatabaseRow( $db->getRow( $sql ) ); }