/** * Update * * Method is the base update function for this object class * * @return string */ function _update($properties = null) { //reasons to return if (is_null($properties)) { return false; } //building the query $query = "UPDATE `" . $this->_tbl . "_cstm`" . " SET "; //Updating the class property values foreach ($properties as $property => $value) { if ($property == 'id') { continue; } //Making sure that system properties are also set switch ($property) { case 'id_c': break; case 'date_created': break; case 'date_modified': $date =& eFactory::getDate(time()); $query .= " `date_modified` = '" . $date->toMySQL() . "',"; break; default: $query .= " `" . $property . "` = '" . $value . "',"; break; } } $query = substr($query, 0, strlen($query) - 1); $query .= " WHERE `id_c` = '" . $this->id . "';"; if ($this->query($query)) { return $this->id; } return false; }