本文整理汇总了PHP中Report::getFiltersStructure方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::getFiltersStructure方法的具体用法?PHP Report::getFiltersStructure怎么用?PHP Report::getFiltersStructure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::getFiltersStructure方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCommonAttributes
/**
* @param ReportWizardForm $formModel
*/
protected function setCommonAttributes(ReportWizardForm $formModel)
{
$formModel->id = $this->report->getId();
$formModel->description = $this->report->getDescription();
$formModel->moduleClassName = $this->report->getModuleClassName();
if ($this->report->getOwner()->id > 0) {
$formModel->ownerId = (int) $this->report->getOwner()->id;
$formModel->ownerName = strval($this->report->getOwner());
}
$formModel->name = $this->report->getName();
$formModel->type = $this->report->getType();
$formModel->filtersStructure = $this->report->getFiltersStructure();
$formModel->currencyConversionType = $this->report->getCurrencyConversionType();
$formModel->spotConversionCurrencyCode = $this->report->getSpotConversionCurrencyCode();
if ($this->report->isNew()) {
$formModel->setIsNew();
}
$formModel->setExplicitReadWriteModelPermissions($this->report->getExplicitReadWriteModelPermissions());
$formModel->filters = $this->report->getFilters();
$formModel->orderBys = $this->report->getOrderBys();
$formModel->groupBys = $this->report->getGroupBys();
$formModel->displayAttributes = $this->report->getDisplayAttributes();
$formModel->drillDownDisplayAttributes = $this->report->getDrillDownDisplayAttributes();
$formModel->chart = $this->report->getChart();
}
示例2: makeFiltersContent
/**
* @param RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter
* @return null|string
*/
protected function makeFiltersContent(RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter)
{
$filters = $this->report->getFilters();
$filtersStructure = $this->report->getFiltersStructure();
$resolvedFilters = $this->resolveFiltersForVariableStates($filters, $filtersStructure);
$resolvedFilters = $this->resolveFiltersForReadPermissions($resolvedFilters, $filtersStructure);
$builder = new FiltersReportQueryBuilder($joinTablesAdapter, $filtersStructure);
return $builder->makeQueryContent($resolvedFilters);
}
示例3: testResolveGroupBysAsFilters
public function testResolveGroupBysAsFilters()
{
$report = new Report();
$report->setType(Report::TYPE_ROWS_AND_COLUMNS);
$groupBy = new GroupByForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
$groupBy->attributeIndexOrDerivedType = 'lastName';
$groupBy->axis = 'x';
$report->addGroupBy($groupBy);
$groupBy2 = new GroupByForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
$groupBy2->attributeIndexOrDerivedType = 'firstName';
$groupBy2->axis = 'y';
$report->addGroupBy($groupBy2);
$this->assertNull($report->getFiltersStructure());
$getData = array('groupByRowValuelastName' => '50', 'groupByRowValuefirstName' => '');
$this->assertCount(0, $report->getFilters());
$report->resolveGroupBysAsFilters($getData);
$this->assertEquals('(1 AND 2)', $report->getFiltersStructure());
$filters = $report->getFilters();
$this->assertCount(2, $filters);
$this->assertEquals('lastName', $filters[0]->getAttributeIndexOrDerivedType());
$this->assertEquals('50', $filters[0]->value);
$this->assertEquals(OperatorRules::TYPE_EQUALS, $filters[0]->operator);
$this->assertEquals('firstName', $filters[1]->getAttributeIndexOrDerivedType());
$this->assertEmpty($filters[1]->value);
$this->assertEquals(OperatorRules::TYPE_EQUALS, $filters[1]->operator);
$report = new Report();
$report->setType(Report::TYPE_ROWS_AND_COLUMNS);
$groupBy = new GroupByForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
$groupBy->attributeIndexOrDerivedType = 'lastName';
$groupBy->axis = 'x';
$report->addGroupBy($groupBy);
$groupBy2 = new GroupByForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
$groupBy2->attributeIndexOrDerivedType = 'firstName';
$groupBy2->axis = 'y';
$report->addGroupBy($groupBy2);
$this->assertNull($report->getFiltersStructure());
$getData = array('groupByRowValuelastName' => '50');
$this->assertCount(0, $report->getFilters());
$report->resolveGroupBysAsFilters($getData);
$this->assertEquals('(1 AND 2)', $report->getFiltersStructure());
$filters = $report->getFilters();
$this->assertCount(2, $filters);
$this->assertEquals('lastName', $filters[0]->getAttributeIndexOrDerivedType());
$this->assertEquals('50', $filters[0]->value);
$this->assertEquals(OperatorRules::TYPE_EQUALS, $filters[0]->operator);
$this->assertEquals('firstName', $filters[1]->getAttributeIndexOrDerivedType());
$this->assertNull($filters[1]->value);
$this->assertEquals(OperatorRules::TYPE_IS_NULL, $filters[1]->operator);
}
示例4: resolveReportToSavedReport
/**
* @param Report $report
* @param SavedReport$savedReport
*/
public static function resolveReportToSavedReport(Report $report, SavedReport $savedReport)
{
$savedReport->description = $report->getDescription();
$savedReport->moduleClassName = $report->getModuleClassName();
$savedReport->name = $report->getName();
$savedReport->owner = $report->getOwner();
$savedReport->type = $report->getType();
$data = array();
$data['filtersStructure'] = $report->getFiltersStructure();
$data['currencyConversionType'] = $report->getCurrencyConversionType();
$data['spotConversionCurrencyCode'] = $report->getSpotConversionCurrencyCode();
$data[ComponentForReportForm::TYPE_FILTERS] = self::makeArrayFromComponentFormsAttributesData($report->getFilters());
$data[ComponentForReportForm::TYPE_ORDER_BYS] = self::makeArrayFromComponentFormsAttributesData($report->getOrderBys());
$data[ComponentForReportForm::TYPE_GROUP_BYS] = self::makeArrayFromComponentFormsAttributesData($report->getGroupBys());
$data[ComponentForReportForm::TYPE_DISPLAY_ATTRIBUTES] = self::makeArrayFromComponentFormsAttributesData($report->getDisplayAttributes());
$data[ComponentForReportForm::TYPE_DRILL_DOWN_DISPLAY_ATTRIBUTES] = self::makeArrayFromComponentFormsAttributesData($report->getDrillDownDisplayAttributes());
if ($report->getChart()->type != null) {
$data['chart'] = self::makeArrayFromChartForReportFormAttributesData($report->getChart());
}
$savedReport->serializedData = serialize($data);
}
示例5: saveCalendarWithSerializedData
/**
* Save calendar with serialized data.
* @param Report $report
* @param SavedCalendar $savedCalendar
* @param array $wizardFormPostData
* @throws FailedToSaveModelException
*/
public static function saveCalendarWithSerializedData(Report $report, SavedCalendar $savedCalendar, $wizardFormPostData)
{
$filtersData = ArrayUtil::getArrayValue($wizardFormPostData, ComponentForReportForm::TYPE_FILTERS);
if ($filtersData != null) {
$sanitizedFiltersData = DataToReportUtil::sanitizeFiltersData($report->getModuleClassName(), $report->getType(), $filtersData);
$unserializedData = array(ComponentForReportForm::TYPE_FILTERS => $sanitizedFiltersData, 'filtersStructure' => $report->getFiltersStructure());
$savedCalendar->serializedData = serialize($unserializedData);
}
if (!$savedCalendar->save()) {
throw new FailedToSaveModelException();
}
}