当前位置: 首页>>代码示例>>PHP>>正文


PHP Generic::listRows方法代码示例

本文整理汇总了PHP中Generic::listRows方法的典型用法代码示例。如果您正苦于以下问题:PHP Generic::listRows方法的具体用法?PHP Generic::listRows怎么用?PHP Generic::listRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Generic的用法示例。


在下文中一共展示了Generic::listRows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: viewDetailsRecords

 public function viewDetailsRecords($in)
 {
     $wo = $this->wo;
     $tableName = $this->tableName;
     if (!WOOOF::hasContent($tableName)) {
         $wo->log(WOOOF_loggingLevels::WOOOF_ERROR, "1000 No value for tableName");
         return false;
     }
     $id = $wo->getFromArray($in, 'id');
     $wo->debug("Generic.viewDetailsRecords for '{$tableName}' and Record [{$id}]");
     $out = '';
     $sql = "\n\t\t\tselect\n\t\t\ttmd.tableName, cmd.name, cmd.columnToStore\n\t\t\tfrom\n\t\t\t__columnMetaData cmd, __tableMetaData tmd\n\t\t\twhere\n\t\t\tcmd.valuesTable = '{$tableName}' and\n\t\t\ttmd.id = cmd.tableId\n\t\t";
     $detailTables = $wo->db->query($sql);
     if ($detailTables === FALSE) {
         $wo->log(WOOOF_loggingLevels::WOOOF_ERROR, "1080 Failed look for Detail Tables");
         return false;
     }
     $out .= '<h3>Detail Records</h3>';
     while (($aDetailTable = $wo->db->fetchAssoc($detailTables)) !== NULL) {
         $sql = "select count(*) from {$aDetailTable['tableName']} where {$aDetailTable['name']} = '{$id}'";
         $aDetailsCount = $wo->db->query($sql);
         if ($aDetailsCount === FALSE) {
             $wo->log(WOOOF_loggingLevels::WOOOF_ERROR, "1085 Failed look for Detail Count");
             return false;
         }
         $detailsCount = $wo->db->fetchRow($aDetailsCount)[0];
         $out .= '<h4>' . $aDetailTable['tableName'] . ' ' . $detailsCount . '</h4>';
         if ($detailsCount > 0) {
             $detGen = new Generic($aDetailTable['tableName']);
             $detOutput = $detGen->listRows(array('_where' => "{$aDetailTable['name']} = '{$id}'"));
             if ($detOutput === FALSE) {
                 return FALSE;
             }
             $out .= $detOutput['contentData'];
             $out .= '<br>';
         }
     }
     // foreach detail Table
     return $out;
 }
开发者ID:ormikopo1988,项目名称:movierama,代码行数:40,代码来源:Generic.php

示例2: array

//$__isSiteBuilderPage = true;
require_once '../setup.inc.php';
$requestedAction = 'read';
$pageLocation = '1';
$browserTitle = 'Generic List';
$timers = array();
$wo = new WOOOF();
if (!$wo->constructedOk) {
    $wo->handleShowStopperError("1000 Failed to init WOOOF.");
}
$paramNames = array('_tableName', '_where', '_orderBy', '_fragmentsFile', '_cudFormURL');
$in = $wo->getMultipleGetPost($paramNames);
//$in['where'] = "region='Greece'";
$tableName = $in['_tableName'];
$table = new Generic($tableName, $wo);
$tpl = $table->listRows($in);
// if ( $tpl === FALSE ) { $wo->handleShowStopperError( print_r($errors,true) ); }
if ($tpl === FALSE) {
    // $wo->handleShowStopperError( $error );
    $tpl = array('browserTitle' => $browserTitle, 'content' => 'Sorry, smg went wrong', 'errorMessage' => nl2br($wo->getErrorsAsStringAndClear()), 'message' => '', 'contentTop' => '');
} else {
    if (!isset($tpl['browserTitle'])) {
        $tpl['browserTitle'] = $tableName . ' ' . $browserTitle;
    }
}
$showTables = $table->showTablesAs('links');
if ($showTables !== FALSE) {
    $tpl['contentTop'] .= $showTables . '<br><br>';
}
$wo->fetchApplicationFragment('structural/generic_template.php');
// UNREACHEABLE: As generic_template.php exits at its end!
开发者ID:ormikopo1988,项目名称:movierama,代码行数:31,代码来源:_genericList.php


注:本文中的Generic::listRows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。