PMA\libraries\DisplayResults::setProperties PHP Méthode

setProperties() public méthode

Set properties which were not initialized at the constructor
public setProperties ( integer $unlim_num_rows, array $fields_meta, boolean $is_count, integer $is_export, boolean $is_func, integer $is_analyse, integer $num_rows, integer $fields_cnt, double $querytime, string $pmaThemeImage, string $text_dir, boolean $is_maint, boolean $is_explain, boolean $is_show, array $showtable, string $printview, string $url_query, boolean $editable, boolean $is_browse_dist ) : void
$unlim_num_rows integer the total number of rows returned by the SQL query without any appended "LIMIT" clause programmatically
$fields_meta array meta information about fields
$is_count boolean statement is SELECT COUNT
$is_export integer statement contains INTO OUTFILE
$is_func boolean statement contains a function like SUM()
$is_analyse integer statement contains PROCEDURE ANALYSE
$num_rows integer total no. of rows returned by SQL query
$fields_cnt integer total no.of fields returned by SQL query
$querytime double time taken for execute the SQL query
$pmaThemeImage string path for theme images directory
$text_dir string text direction
$is_maint boolean statement contains a maintenance command
$is_explain boolean statement contains EXPLAIN
$is_show boolean statement contains SHOW
$showtable array table definitions
$printview string print view was requested
$url_query string URL query
$editable boolean whether the results set is editable
$is_browse_dist boolean whether browsing distinct values
Résultat void
    public function setProperties($unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query, $editable, $is_browse_dist)
    {
        $this->__set('unlim_num_rows', $unlim_num_rows);
        $this->__set('fields_meta', $fields_meta);
        $this->__set('is_count', $is_count);
        $this->__set('is_export', $is_export);
        $this->__set('is_func', $is_func);
        $this->__set('is_analyse', $is_analyse);
        $this->__set('num_rows', $num_rows);
        $this->__set('fields_cnt', $fields_cnt);
        $this->__set('querytime', $querytime);
        $this->__set('pma_theme_image', $pmaThemeImage);
        $this->__set('text_dir', $text_dir);
        $this->__set('is_maint', $is_maint);
        $this->__set('is_explain', $is_explain);
        $this->__set('is_show', $is_show);
        $this->__set('showtable', $showtable);
        $this->__set('printview', $printview);
        $this->__set('url_query', $url_query);
        $this->__set('editable', $editable);
        $this->__set('is_browse_distinct', $is_browse_dist);
    }

Usage Example

Exemple #1
0
/**
 * Function to get html for the sql query results table
 *
 * @param DisplayResults $displayResultsObject instance of DisplayResult
 * @param string         $pmaThemeImage        theme image uri
 * @param string         $url_query            url query
 * @param array          $displayParts         the parts to display
 * @param bool           $editable             whether the result table is
 *                                             editable or not
 * @param int            $unlim_num_rows       unlimited number of rows
 * @param int            $num_rows             number of rows
 * @param bool           $showtable            whether to show table or not
 * @param object         $result               result of the executed query
 * @param array          $analyzed_sql_results analyzed sql results
 * @param bool           $is_limited_display   Show only limited operations or not
 *
 * @return String
 */
function PMA_getHtmlForSqlQueryResultsTable($displayResultsObject, $pmaThemeImage, $url_query, $displayParts, $editable, $unlim_num_rows, $num_rows, $showtable, $result, $analyzed_sql_results, $is_limited_display = false)
{
    $printview = isset($_REQUEST['printview']) ? $_REQUEST['printview'] : null;
    $table_html = '';
    $browse_dist = !empty($_REQUEST['is_browse_distinct']);
    if ($analyzed_sql_results['is_procedure']) {
        do {
            if (!isset($result)) {
                $result = $GLOBALS['dbi']->storeResult();
            }
            $num_rows = $GLOBALS['dbi']->numRows($result);
            if ($result !== false && $num_rows > 0) {
                $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
                $fields_cnt = count($fields_meta);
                $displayResultsObject->setProperties($num_rows, $fields_meta, $analyzed_sql_results['is_count'], $analyzed_sql_results['is_export'], $analyzed_sql_results['is_func'], $analyzed_sql_results['is_analyse'], $num_rows, $fields_cnt, $GLOBALS['querytime'], $pmaThemeImage, $GLOBALS['text_dir'], $analyzed_sql_results['is_maint'], $analyzed_sql_results['is_explain'], $analyzed_sql_results['is_show'], $showtable, $printview, $url_query, $editable, $browse_dist);
                $displayParts = array('edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, 'sort_lnk' => '1', 'nav_bar' => '1', 'bkm_form' => '1', 'text_btn' => '1', 'pview_lnk' => '1');
                $table_html .= $displayResultsObject->getTable($result, $displayParts, $analyzed_sql_results, $is_limited_display);
            }
            $GLOBALS['dbi']->freeResult($result);
            unset($result);
        } while ($GLOBALS['dbi']->moreResults() && $GLOBALS['dbi']->nextResult());
    } else {
        if (isset($result) && $result) {
            $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
            $fields_cnt = count($fields_meta);
        }
        $_SESSION['is_multi_query'] = false;
        $displayResultsObject->setProperties($unlim_num_rows, $fields_meta, $analyzed_sql_results['is_count'], $analyzed_sql_results['is_export'], $analyzed_sql_results['is_func'], $analyzed_sql_results['is_analyse'], $num_rows, $fields_cnt, $GLOBALS['querytime'], $pmaThemeImage, $GLOBALS['text_dir'], $analyzed_sql_results['is_maint'], $analyzed_sql_results['is_explain'], $analyzed_sql_results['is_show'], $showtable, $printview, $url_query, $editable, $browse_dist);
        $table_html .= $displayResultsObject->getTable($result, $displayParts, $analyzed_sql_results, $is_limited_display);
        $GLOBALS['dbi']->freeResult($result);
    }
    return $table_html;
}
DisplayResults