PMA\libraries\DisplayResults::_setMessageInformation PHP 메소드

_setMessageInformation() 개인적인 메소드

Set the content that needs to be shown in message
또한 보기: getTable()
private _setMessageInformation ( string $sorted_column_message, array $analyzed_sql_results, integer $total, integer $pos_next, string $pre_count, string $after_count ) : Message
$sorted_column_message string the message for sorted column
$analyzed_sql_results array the analyzed query
$total integer the total number of rows returned by the SQL query without any programmatically appended LIMIT clause
$pos_next integer the offset for next page
$pre_count string the string renders before row count
$after_count string the string renders after row count
리턴 Message $message an object of Message
    private function _setMessageInformation($sorted_column_message, $analyzed_sql_results, $total, $pos_next, $pre_count, $after_count)
    {
        $unlim_num_rows = $this->__get('unlim_num_rows');
        // To use in isset()
        if (!empty($analyzed_sql_results['statement']->limit)) {
            $first_shown_rec = $analyzed_sql_results['statement']->limit->offset;
            $row_count = $analyzed_sql_results['statement']->limit->rowCount;
            if ($row_count < $total) {
                $last_shown_rec = $first_shown_rec + $row_count - 1;
            } else {
                $last_shown_rec = $first_shown_rec + $total - 1;
            }
        } elseif ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS || $pos_next > $total) {
            $first_shown_rec = $_SESSION['tmpval']['pos'];
            $last_shown_rec = $total - 1;
        } else {
            $first_shown_rec = $_SESSION['tmpval']['pos'];
            $last_shown_rec = $pos_next - 1;
        }
        $table = new Table($this->__get('table'), $this->__get('db'));
        if ($table->isView() && $total == $GLOBALS['cfg']['MaxExactCountViews']) {
            $message = Message::notice(__('This view has at least this number of rows. ' . 'Please refer to %sdocumentation%s.'));
            $message->addParam('[doc@cfg_MaxExactCount]');
            $message->addParam('[/doc]');
            $message_view_warning = Util::showHint($message);
        } else {
            $message_view_warning = false;
        }
        $message = Message::success(__('Showing rows %1s - %2s'));
        $message->addParam($first_shown_rec);
        if ($message_view_warning !== false) {
            $message->addParamHtml('... ' . $message_view_warning);
        } else {
            $message->addParam($last_shown_rec);
        }
        $message->addText('(');
        if ($message_view_warning === false) {
            if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
                $message_total = Message::notice($pre_count . __('%1$d total, %2$d in query'));
                $message_total->addParam($total);
                $message_total->addParam($unlim_num_rows);
            } else {
                $message_total = Message::notice($pre_count . __('%d total'));
                $message_total->addParam($total);
            }
            if (!empty($after_count)) {
                $message_total->addHtml($after_count);
            }
            $message->addMessage($message_total, '');
            $message->addText(', ', '');
        }
        $message_qt = Message::notice(__('Query took %01.4f seconds.') . ')');
        $message_qt->addParam($this->__get('querytime'));
        $message->addMessage($message_qt, '');
        if (!is_null($sorted_column_message)) {
            $message->addHtml($sorted_column_message, '');
        }
        return $message;
    }
DisplayResults