本文整理汇总了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;
}
示例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!