Return a count of database rows populated the given field
Usage
// basic usage
$int = $fields->getNumRows(Field $field);
// usage with all arguments
$int = $fields->getNumRows(Field $field, array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
field | Field | |
options (optional) | array | Optionally specify any of the following options:
|
Return value
int
array
Returns array only if getPageIDs option set, otherwise returns a count of rows.
Exceptions
Method can throw exceptions on error:
WireException
- If given option for page or template doesn't resolve to actual page/template.
$fields methods and properties
API reference based on ProcessWire core version 3.0.236