ColModifierSubRecordCount
extends ColModifier
in package
Counts records in a subtable.
E.g. count the records in a gallery_images table associated with records in a galleries table The database query isn't done until the first record lookup
Table of Contents
Properties
Methods
- __construct() : mixed
- modify() : string
- Modify a column value This value will be html/csv/etc encoded afterwards.
Properties
$column
private
mixed
$column
$data
private
mixed
$data
= null
$table
private
mixed
$table
Methods
__construct()
public
__construct(string $table, string $column) : mixed
Parameters
- $table : string
-
The table that contains the records
- $column : string
-
The column in $table that links to the main table, which by convention is the table's singular name followed by _id, e.g. if $table is 'galleries' then $column is usually 'gallery_id'
modify()
Modify a column value This value will be html/csv/etc encoded afterwards.
public
modify(string $val, string $field_name, mixed $row) : string
Parameters
- $val : string
-
The incoming value
- $field_name : string
-
The name of the field being modified
- $row : mixed
-
The full row of data
Return values
string —The modified value