SilverStripe\Reports\Report
Base "abstract" class creating reports on your data.
Creating reports
================
Creating a new report is a matter overloading a few key methods
: Return the title - i18n is your responsibility
: Return the description - i18n is your responsibility
: Return a SS_List of the search results
: Return information about the columns in this report.
: Return a FieldList of the fields that can be used to filter this
report.
If you wish to modify the report in more extreme ways, you could overload these methods instead.
: Return a FormField in the place where your report's TableListField
usually appears.
: Return the FieldList representing the complete right-hand area of the
report, including the title, description, parameter fields, and results.
Showing reports to the user
===========================
Right now, all subclasses of SS_Report will be shown in the ReportAdmin. In SS3 there is only
one place where reports can go, so this class is greatly simplifed from its version in SS2.
Synopsis
- // members
- protected string $title = '';
- protected string $description = '';
- protected $dataClass = SiteTree::class;
- protected integer $sort = 0;
- private static array $excluded_reports = ;
- // methods
- public void title()
- public string getTitle()
- public void description()
- public DataQuery sourceQuery()
- public SS_List records()
- public void columns()
- public void dataClass()
- public void getLink()
- protected string sanitiseClassName()
- public int getCount()
- public static array get_excluded_reports()
- public static array get_reports()
- public FieldList getCMSFields()
- public void getCMSActions()
- public FormField getReportField()
- public boolean canView()
- public boolean|null extendedCan()
- public string TreeTitle()
- public array getBreadcrumbs()
- protected array getSourceParams()
Hierarchy
Extends
- SilverStripe\View\ViewableData
Members
private
- $excluded_reports
—
array
Reports which should not be collected and returned in get_reports
protected
-
$dataClass
The class of object being managed by this report. - $description
—
string
This is a description about what this report does. Used by the ReportAdmin templates. - $sort
—
int
A field that specifies the sort order of this report - $title
—
string
This is the title of the report, used by the ReportAdmin templates.
Methods
protected
- getSourceParams() — Get source params for the report to filter by
- sanitiseClassName() — Sanitise a model class' name for inclusion in a link
public
- TreeTitle() — Return the name of this report, which is used by the templates to render the name of the report in the report tree, the left hand pane inside ReportAdmin.
- canView()
- columns()
- dataClass() — Return the data class for this report
- description() — Return the description of this report.
- extendedCan() — Helper to assist with permission extension
- getBreadcrumbs() — Return additional breadcrumbs for this report. Useful when this report is a child of another.
- getCMSActions()
- getCMSFields() — Returns a FieldList with which to create the CMS editing form.
- getCount() — counts the number of objects returned
- getLink()
- getReportField() — Return a field, such as a {@link GridField} that is used to show and manipulate data relating to this report.
- getTitle() — Allows access to title as a property
- get_excluded_reports() — Return an array of excluded reports. That is, reports that will not be included in the list of reports in report admin in the CMS.
- get_reports() — Return the SS_Report objects making up the given list.
- records() — Return a SS_List records for this report.
- sourceQuery() — Return the {@link DataQuery} that provides your report data.
- title() — Return the title of this report.