Piwik\ArchiveProcessor\

Record

Since Matomo 5.0.0

Methods

The class defines the following methods:

make()

Signature

  • It accepts the following parameter(s):

    • $type

    • $name

  • It does not return anything or a mixed result.

setPlugin()

Signature

  • It accepts the following parameter(s):

    • $plugin (string|null) —
  • It returns a Record value.

setName()

Signature

  • It accepts the following parameter(s):

    • $name (string) —
  • It returns a Record value.

setColumnToSortByBeforeTruncation()

Signature

  • It accepts the following parameter(s):

    • $columnToSortByBeforeTruncation (int|string) —
  • It returns a Record value.

setMaxRowsInTable()

Signature

  • It accepts the following parameter(s):

    • $maxRowsInTable (int|null) —
  • It returns a Record value.

setMaxRowsInSubtable()

Signature

  • It accepts the following parameter(s):

    • $maxRowsInSubtable (int|null) —
  • It returns a Record value.

getPlugin()

Signature

  • Returns: string|null

getName()

Signature

  • It returns a string value.

getColumnToSortByBeforeTruncation()

Signature

  • Returns: int|string

getMaxRowsInTable()

Signature

  • Returns: int|null

getMaxRowsInSubtable()

Signature

  • Returns: int|null

setType()

Signature

  • It accepts the following parameter(s):

    • $type (string) —
  • It returns a Record value.

getType()

Signature

  • It returns a string value.

setIsCountOfBlobRecordRows()

Signature

  • It accepts the following parameter(s):

    • $dependentRecordName (string) —

    • $isRecursive (bool) —

  • It returns a Record value.

setIsCountOfBlobRecordLeafRows()

Signature

  • It accepts the following parameter(s):

    • $dependentRecordName (string) —
  • It returns a Record value.

getCountOfRecordName()

Signature

  • Returns: string|null

getCountOfRecordNameIsRecursive()

Signature

  • It returns a bool value.

getCountOfRecordNameIsForLeafs()

Signature

  • It returns a bool value.

setColumnToRenameAfterAggregation()

Signature

  • It accepts the following parameter(s):

    • $columnToRenameAfterAggregation (array|null) —
  • It returns a Record value.

getColumnToRenameAfterAggregation()

Signature

  • Returns: array|null

setBlobColumnAggregationOps()

Signature

  • It accepts the following parameter(s):

    • $blobColumnAggregationOps (array|null) —
  • It returns a Record value.

getBlobColumnAggregationOps()

Signature

  • Returns: array|null

setMultiplePeriodTransform()

Signature

  • It accepts the following parameter(s):

    • $multiplePeriodTransform (callable|null) —
  • It returns a Record value.

getMultiplePeriodTransform()

Signature

  • Returns: callable|null

setAggregatedRecordTransform()

Sets a transform applied to this blob record's aggregated table during non-day archiving, after the day blobs have been aggregated together (additive columns summed, columns marked 'skip' in the aggregation ops left untouched) and before the table is truncated and stored.

Use this for columns that cannot be summed across child periods and must be recomputed from the aggregated additive columns — for example a table-relative ratio, index or score. Mark such a column 'skip' via {@see setBlobColumnAggregationOps()} so it is not summed, then recompute it here. Because the transform runs before truncation, a column it (re)computes can be used as {@see setColumnToSortByBeforeTruncation()}.

Only used for non-day periods; the day archive builds the record from logs via the RecordBuilder's aggregate() and should apply any equivalent computation there.

Applies on both the standard blob path and the built-from-flat path ({@see setBuiltFromFlatRecord()}): each record's transform runs on that record's own aggregated table, so a flat base record and the hierarchy rebuilt from it are each transformed (the hierarchy after it is built) before being stored.

Signature

  • It accepts the following parameter(s):
    • $transform (callable|null) — Signature: function (\Piwik\DataTable $table, ArchiveProcessor $archiveProcessor, Record $record): void The callback mutates $table in place.
  • It returns a Record value.

getAggregatedRecordTransform()

Signature

  • Returns: callable|null

setBuiltFromFlatRecord()

Marks this blob record as being derived from a flat blob record during non-day aggregation.

Use this when day archives store a flat representation and non-day archives should rebuild hierarchy from it. The flat record must be present in getRecordMetadata().

Signature

  • It accepts the following parameter(s):
    • $flatRecordName (string) — Name of the flat blob record to aggregate first.
    • $flatToHierarchyPathCallback (callable) — Callback used when rebuilding hierarchy. Signature: function (Row $flatRow, ArchiveProcessor $archiveProcessor, Record $hierarchicalRecord): ?array Return value is the path of labels to map the flat row into the hierarchy.
    • $legacyHierarchyToFlatReducerCallback (callable|null) — Optional callback that can merge legacy hierarchical aggregates into the flat table when some periods do not have the flat record yet. Signature: function (DataTable $legacyHierarchy, DataTable $flatTable, ArchiveProcessor $archiveProcessor, Record $hierarchicalRecord): void The callback is invoked once per legacy source period hierarchy table.
  • It returns a Record value.

getBuiltFromFlatRecord()

Signature

  • Returns: string|null

getFlatToHierarchyPathCallback()

See Also

  • setBuiltFromFlatRecord()

Signature

  • Returns: callable|null

getLegacyHierarchyToFlatReducerCallback()

See Also

  • setBuiltFromFlatRecord()

Signature

  • Returns: callable|null