From 7c5f80d3fd5c44d56ce223cafbff9bec45684ffc Mon Sep 17 00:00:00 2001 From: Thomas Misund Date: Tue, 23 Nov 2010 21:14:56 +0100 Subject: [PATCH] Wee bit of documentation --- inside/Concert.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/inside/Concert.php b/inside/Concert.php index acf246c..6c0a550 100644 --- a/inside/Concert.php +++ b/inside/Concert.php @@ -128,12 +128,14 @@ class Concert { } /** - * Stores a new concert to the database + * Stores a new concert to the database, or updates an existing concert. * - * Called by _updateConcert() in ActionParser.php + * Called by _updateConcert() in ActionParser.php. */ - public function store(){ - if ($this->id == NULL){ + public function store(){ + if ($this->id == NULL) { + // Storing a new concert + if (!$this->_validate()){ $GLOBALS['extraScriptParams']['page'] = "register-concert"; return false; @@ -190,6 +192,8 @@ class Concert { notify("Problemer med registrering av konsert."); } } else { + // Updating an existing concert + if (!$this->_validate()){ $GLOBALS['extraScriptParams']['page'] = "edit-concert"; return false; @@ -255,6 +259,7 @@ class Concert { $sql .= "UPDATE program SET vedlegg=" . $this->conn->quoteSmart($this->picture) . " WHERE id=" . $this->id; + // @TODO Flush image cache for the old image, as the new one will have the same name } $result = $this->conn->query($sql);