/** * delete ListTableDescription object from database * this function also deletes the ListTable that is connected to current object * @param string $title title of ListTableDescription * @return bool indicates if ListTableDescription has been deleted */ function delete($title) { $this->_log->trace("deleting ListTableDescription from database (title=" . $title . ")"); # create encoded_key_string $encoded_key_string = parent::_encode_key_string(LISTTABLEDESCRIPTION_TITLE_FIELD_NAME . "='" . $title . "'"); if (parent::delete($encoded_key_string) == FALSE) { return FALSE; } # create key string for user_list_permissions $permission_key_string = USERLISTTABLEPERMISSIONS_LISTTABLE_TITLE_FIELD_NAME . "='" . $title . "'"; if ($this->_user_list_permissions->delete($permission_key_string) == FALSE) { # copy error strings from user_list_permissions $this->error_message_str = $this->_user_list_permissions->get_error_message_str(); $this->error_log_str = $this->_user_list_permissions->get_error_log_str(); $this->error_str = $this->_user_list_permissions->get_error_str(); return FALSE; } $this->_log->trace("deleted ListTableDescription (title=" . $title . ")"); return TRUE; }
/** * check if user already exists * @param string $name name of user * @return bool indicates if user already exists */ function exists($name) { # create encoded_key_string $encoded_key_string = parent::_encode_key_string(USER_NAME_FIELD_NAME . "='" . $name . "'"); $record = parent::select_record($encoded_key_string); if (count($record) > 0) { $this->_log->debug("user already exists (name=" . $name . ")"); return TRUE; } else { if (strlen($this->get_error_message_str()) == 0) { $this->_log->debug("user does not exist (name=" . $name . ")"); return FALSE; } else { return FALSE; } } }