本文整理汇总了PHP中Reports::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::instance方法的具体用法?PHP Reports::instance怎么用?PHP Reports::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::instance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllReportsByObjectType
/**
* Return all reports
*
* @return array
*/
static function getAllReportsByObjectType()
{
$ignore_context_reports = Reports::findAll(array("conditions" => "ignore_context = 1"));
$reports_result = Reports::instance()->listing();
$reports = $reports_result->objects;
$to_merge_reports = array();
foreach ($ignore_context_reports as $icr) {
$add = true;
foreach ($reports as $r) {
if ($r->getId() == $icr->getId()) {
$add = false;
break;
}
}
if ($add) {
$to_merge_reports[] = $icr;
}
}
$reports = array_merge($reports, $to_merge_reports);
$reports = feng_sort($reports, "getObjectName");
$result = array();
foreach ($reports as $report) {
if (array_key_exists($report->getReportObjectTypeId(), $result)) {
$result[$report->getReportObjectTypeId()][] = $report;
} else {
$result[$report->getReportObjectTypeId()] = array($report);
}
}
return $result;
}
示例2: paginate
/**
* This function will return paginated result. Result is an array where first element is
* array of returned object and second populated pagination object that can be used for
* obtaining and rendering pagination data using various helpers.
*
* Items and pagination array vars are indexed with 0 for items and 1 for pagination
* because you can't use associative indexing with list() construct
*
* @access public
* @param array $arguments Query argumens (@see find()) Limit and offset are ignored!
* @param integer $items_per_page Number of items per page
* @param integer $current_page Current page number
* @return array
*/
function paginate($arguments = null, $items_per_page = 10, $current_page = 1)
{
if (isset($this) && instance_of($this, 'Reports')) {
return parent::paginate($arguments, $items_per_page, $current_page);
} else {
return Reports::instance()->paginate($arguments, $items_per_page, $current_page);
}
// if
}
示例3: lang
$coltype = $cp->getOgType();
} else {
$name = lang('field ' . $model . ' ' . $condition->getFieldName());
$coltype = array_key_exists($condition->getFieldName(), $types) ? $types[$condition->getFieldName()] : '';
$paramName = $condition->getFieldName();
if (str_starts_with($coltype, 'DATE') && !$condition->getIsParametrizable()) {
$cond_value = DateTimeValueLib::dateFromFormatAndString('m/d/Y', $condition->getValue())->format(user_config_option('date_format'));
$condition->setValue($cond_value);
}
}
$paramValue = isset($parameters[$paramName]) ? $parameters[$paramName] : '';
$value = $condition->getIsParametrizable() ? clean($paramValue) : clean($condition->getValue());
eval('$managerInstance = ' . $model . "::instance();");
$externalCols = $managerInstance->getExternalColumns();
if (in_array($condition->getFieldName(), $externalCols)) {
$value = clean(Reports::instance()->getExternalColumnValue($condition->getFieldName(), $value, $managerInstance));
}
if ($value != '') {
$conditionHtml .= '- ' . $name . ' ' . ($condition->getCondition() != '%' ? $condition->getCondition() : lang('ends with')) . ' ' . format_value_to_print($condition->getFieldName(), $value, $coltype, '', '"', user_config_option('date_format')) . '<br/>';
}
}
}
?>
<div id="pdfOptions" style="display:none;">
<span class="bold"><?php
echo lang('report pdf options');
?>
</span><hr/>
<?php
echo lang('report pdf page layout');
示例4: manager
/**
* Return manager instance
*
* @access protected
* @param void
* @return Report
*/
function manager() {
if(!($this->manager instanceof Reports )) $this->manager = Reports::instance();
return $this->manager;
} // manager
示例5: manager
/**
* Return manager instance
*
* @access protected
* @param void
* @return Report
*/
function manager()
{
if (!$this->manager instanceof Reports) {
$this->manager = Reports::instance();
}
return $this->manager;
}