Свойство | Type | Description | |
---|---|---|---|
$maxVisitsSummed | @see sumRow - implementation detail | ||
$subtableId |
Méthode | Description | |
---|---|---|
__construct ( array $row = [] ) | Constructor. | |
__destruct ( ) | When destroyed, a row destroys its associated subtable if there is one. | |
__toString ( ) : string | Applies a basic rendering to the Row and returns the output. | |
addColumn ( string $name, mixed $value ) | Add a new column to the row. If the column already exists, throws an exception. | |
addColumns ( array $columns ) : void | Add many columns to this row. | |
addMetadata ( string $name, mixed $value ) | Add a new metadata to the row. If the metadata already exists, throws an exception. | |
compareElements ( mixed $elem1, mixed $elem2 ) : boolean | Helper function to compare array elements | |
deleteColumn ( string $name ) : boolean | Deletes the given column. | |
deleteMetadata ( boolean | string $name = false ) : boolean | Deletes one metadata value or all metadata values. | |
export ( ) : array | Used when archiving to serialize the Row's properties. | |
getColumn ( string $name ) : mixed | false | Returns a column by name. | |
getColumns ( ) : array | Returns the array containing all the columns. | |
getIdSubDataTable ( ) : integer | null | Returns the ID of the subDataTable. | |
getMetadata ( string | null $name = null ) : mixed | Returns the array of all metadata, or one requested metadata value. | |
getSubtable ( ) : |
Returns the associated subtable, if one exists. Returns false if none exists. | |
hasColumn ( string $name ) : boolean | Returns true if a column having the given name is already registered. The value will not be evaluated, it will just check whether a column exists independent of its value. | |
isEqual ( |
Helper function that tests if two rows are equal. | |
isSubtableLoaded ( ) : boolean | Returns true if the subtable is currently loaded in memory via {@link Piwik\DataTable\Manager}. | |
isSummaryRow ( ) : boolean | Returns true if this row is the summary row, false if otherwise. This function depends on the label of the row, and so, is not 100% accurate. | |
removeSubtable ( ) | Removes the subtable reference. | |
renameColumn ( string $oldName, string $newName ) | Renames a column. | |
setColumn ( string $name, mixed $value ) | Set the value $value to the column called $name. | |
setColumns ( array $columns ) | Set all the columns at once. Overwrites **all** previously set columns. | |
setMetadata ( string $name, mixed $value ) | Set the value $value to the metadata called $name. | |
setNonLoadedSubtableId ( integer $subtableId ) | ||
setSubtable ( |
Attaches a subtable to this row, overwriting the existing subtable, if any. | |
sumRow ( |
Sums the given $rowToSum columns values to the existing row column values. | |
sumRowMetadata ( |
Sums the metadata in $rowToSum with the metadata in $this row. | |
sumSubtable ( |
Sums a DataTable to this row's subtable. If this row has no subtable a new one is created. |
Méthode | Description | |
---|---|---|
sumRowArray ( number | boolean $thisColumnValue, number | array $columnToSumValue ) : array | integer | Helper function: sums 2 values | |
warnWhenSummingTwoStrings ( $thisColumnValue, $columnToSumValue ) |
Méthode | Description | |
---|---|---|
getColumnValuesMerged ( $operation, $thisColumnValue, $columnToSumValue, $thisRow, $rowToSum ) | ||
isSummableColumn ( $columnName ) | ||
warnIfSubtableAlreadyExists ( ) |
public __construct ( array $row = [] ) | ||
$row | array | An array with the following structure: array( Row::COLUMNS => array('label' => 'Piwik', 'column1' => 42, 'visits' => 657, 'time_spent' => 155744), Row::METADATA => array('logo' => 'test.png'), Row::DATATABLE_ASSOCIATED => $subtable // DataTable object // (but in the row only the ID will be stored) ) |
public __destruct ( ) |
public __toString ( ) : string | ||
Résultat | string | describing the row. Example: "- 1 ['label' => 'piwik', 'nb_uniq_visitors' => 1685, 'nb_visits' => 1861] [] [idsubtable = 1375]" |
public addColumns ( array $columns ) : void | ||
$columns | array | Name/Value pairs, e.g., `array('name' => $value , ...)` |
Résultat | void |
public addMetadata ( string $name, mixed $value ) | ||
$name | string | name of the metadata to add. |
$value | mixed | value of the metadata to set. |
public deleteColumn ( string $name ) : boolean | ||
$name | string | The column name. |
Résultat | boolean | `true` on success, `false` if the column does not exist. |
public getColumns ( ) : array | ||
Résultat | array | Example: array( 'column1' => VALUE, 'label' => 'www.php.net' 'nb_visits' => 15894, ) |
public getIdSubDataTable ( ) : integer | null | ||
Résultat | integer | null |
public getSubtable ( ) : |
||
Résultat |
public isSubtableLoaded ( ) : boolean | ||
Résultat | boolean |
public isSummaryRow ( ) : boolean | ||
Résultat | boolean |
public renameColumn ( string $oldName, string $newName ) | ||
$oldName | string | The current name of the column. |
$newName | string | The new name of the column. |
public setColumns ( array $columns ) | ||
$columns | array | eg, `array('label' => 'www.php.net', 'nb_visits' => 15894)` |
public setMetadata ( string $name, mixed $value ) | ||
$name | string | name of the metadata to set. |
$value | mixed | value of the metadata to set. |
public setNonLoadedSubtableId ( integer $subtableId ) | ||
$subtableId | integer |
public setSubtable ( |
||
$subTable | DataTable to associate to this row. | |
Résultat | Returns `$subTable`. |
public sumRow ( |
||
$rowToSum | The row to sum to this row. | |
$enableCopyMetadata | boolean | Whether metadata should be copied or not. |
$aggregationOperations | array | boolean | for columns that should not be summed, determine which aggregation should be used (min, max). format: `array('column name' => 'function name')` |
public sumRowMetadata ( |
||
$rowToSum | ||
$aggregationOperations | array |
public sumSubtable ( |
||
$subTable | Table to sum to this row's subtable. |
protected warnWhenSummingTwoStrings ( $thisColumnValue, $columnToSumValue ) |