/** * select exactly one record from database * @param $db_field_names array array containing db_field_names to select for record * @param $encoded_key_string string unique identifier of record * @return array array containing exactly one record (which is an array) */ function select_record($encoded_key_string, $db_field_names = array()) { # decode key string $key_string = $this->_decode_key_string($encoded_key_string); $this->_log->trace("selecting UserDatabaseTable row (key_string=" . $key_string . ")"); # call parent insert() $row = parent::select_record($encoded_key_string, $db_field_names); # replace decimal marks if (count($this->db_field_names_decimal_marks_to_replace) > 0) { $row = $this->_replace_decimal_marks($row, FALSE); } $this->_log->trace("selected UserDatabaseTable row"); return $row; }
/** * select a specific attachment * @param $attachment_id int unique identifier of an attachment * @return array array containing all attachment details */ function select_record($attachment_id) { $this->_log->trace("selecting ListTableAttachment (attachment_id={$attachment_id})"); # set filter string SQL $encoded_key_string = DB_ID_FIELD_NAME . "='" . $attachment_id . "'"; $record = parent::select_record($encoded_key_string); # strip slashes from attachment $record[LISTTABLEATTACHMENT_ATTACHMENT_FIELD_NAME] = stripslashes($record[LISTTABLEATTACHMENT_ATTACHMENT_FIELD_NAME]); $this->_log->trace("selected ListTableAttachments"); return $record; }