PHP 클래스 Piwik\Plugins\ScheduledReports\API

"generateReport" will generate the requested report (for a specific date range, website and in the requested language). "sendEmailReport" will send the report by email to the recipients specified for this report. You can also get the list of all existing reports via "getReports", create new reports via "addReport", or manage existing reports with "updateReport" and "deleteReport". See also the documentation about Scheduled Email reports in Piwik.
상속: extends Piwik\Plugin\API
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cache static cache storing reports

공개 메소드들

메소드 설명
__construct ( Psr\Log\LoggerInterface $logger )
addReport ( integer $idSite, string $description, string $period, integer $hour, string $reportType, string $reportFormat, array $reports, array $parameters, boolean | integer $idSegment = false ) : integer Creates a new report and schedules it.
allowMultipleReports ( $reportType )
deleteReport ( integer $idReport ) Deletes a specific report
generateReport ( integer $idReport, string $date, boolean | false | string $language = false, boolean | false | integer $outputType = false, boolean | false | string $period = false, boolean | false | string $reportFormat = false, boolean | false | array $parameters = false ) : array | void Generates a report file.
getReportFormats ( $reportType )
getReportMetadata ( $idSite, $reportType )
getReportRecipients ( $report )
getReportTypes ( )
getReports ( boolean | integer $idSite = false, boolean | string $period = false, boolean | integer $idReport = false, boolean $ifSuperUserReturnOnlySuperUserReports = false, boolean | integer $idSegment = false ) : array Returns the list of reports matching the passed parameters
getSegment ( $idSegment )
isSegmentEditorActivated ( )
sendReport ( $idReport, $period = false, $date = false, $force = false )
updateReport ( $idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false ) Updates an existing report.

비공개 메소드들

메소드 설명
checkUserHasViewPermission ( $login, $idSite )
ensureLanguageSetForUser ( $currentUser )
getAttachments ( $reportRenderer, $report, $processedReports, $prettyDate )
getModel ( )
getReportSubjectAndReportTitle ( $websiteName, $reports )
validateAndTruncateDescription ( &$description )
validateCommonReportAttributes ( $period, $hour, &$description, &$idSegment, $reportType, $reportFormat )
validateIdSegment ( &$idSegment )
validateReportFormat ( $reportType, $reportFormat )
validateReportHour ( $hour )
validateReportParameters ( $reportType, $parameters )
validateReportPeriod ( $period )
validateReportType ( $reportType )
validateRequestedReports ( $idSite, $reportType, $requestedReports )

메소드 상세

__construct() 공개 메소드

public __construct ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

addReport() 공개 메소드

Creates a new report and schedules it.
public addReport ( integer $idSite, string $description, string $period, integer $hour, string $reportType, string $reportFormat, array $reports, array $parameters, boolean | integer $idSegment = false ) : integer
$idSite integer
$description string Report description
$period string Schedule frequency: day, week or month
$hour integer Hour (0-23) when the report should be sent
$reportType string 'email' or any other format provided via the ScheduledReports.getReportTypes hook
$reportFormat string 'pdf', 'html' or any other format provided via the ScheduledReports.getReportFormats hook
$reports array array of reports
$parameters array array of parameters
$idSegment boolean | integer Segment Identifier
리턴 integer idReport generated

allowMultipleReports() 공개 정적인 메소드

public static allowMultipleReports ( $reportType )

deleteReport() 공개 메소드

Deletes a specific report
public deleteReport ( integer $idReport )
$idReport integer

generateReport() 공개 메소드

Generates a report file.
public generateReport ( integer $idReport, string $date, boolean | false | string $language = false, boolean | false | integer $outputType = false, boolean | false | string $period = false, boolean | false | string $reportFormat = false, boolean | false | array $parameters = false ) : array | void
$idReport integer ID of the report to generate.
$date string YYYY-MM-DD
$language boolean | false | string If not passed, will use default language.
$outputType boolean | false | integer 1 = download report, 2 = save report to disk, 3 = output report in browser, 4 = return report content to caller, defaults to download
$period boolean | false | string Defaults to 'day'. If not specified, will default to the report's period set when creating the report
$reportFormat boolean | false | string 'pdf', 'html' or any other format provided via the ScheduledReports.getReportFormats hook
$parameters boolean | false | array array of parameters
리턴 array | void

getReportFormats() 공개 정적인 메소드

public static getReportFormats ( $reportType )

getReportMetadata() 공개 정적인 메소드

public static getReportMetadata ( $idSite, $reportType )

getReportRecipients() 공개 정적인 메소드

public static getReportRecipients ( $report )

getReportTypes() 공개 정적인 메소드

public static getReportTypes ( )

getReports() 공개 메소드

Returns the list of reports matching the passed parameters
public getReports ( boolean | integer $idSite = false, boolean | string $period = false, boolean | integer $idReport = false, boolean $ifSuperUserReturnOnlySuperUserReports = false, boolean | integer $idSegment = false ) : array
$idSite boolean | integer If specified, will filter reports that belong to a specific idsite
$period boolean | string If specified, will filter reports that are scheduled for this period (day,week,month)
$idReport boolean | integer If specified, will filter the report that has the given idReport
$ifSuperUserReturnOnlySuperUserReports boolean
$idSegment boolean | integer If specified, will filter the report that has the given idSegment
리턴 array

getSegment() 공개 정적인 메소드

public static getSegment ( $idSegment )

isSegmentEditorActivated() 공개 정적인 메소드

public static isSegmentEditorActivated ( )

sendReport() 공개 메소드

public sendReport ( $idReport, $period = false, $date = false, $force = false )

updateReport() 공개 메소드

Updates an existing report.
또한 보기: addReport()
public updateReport ( $idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false )

프로퍼티 상세

$cache 공개적으로 정적으로 프로퍼티

static cache storing reports
public static $cache