FindReplaceText
in package
implements
FindReplaceInterface
A doomtool for plaintext database columns.
This is configurable during the construct. A set of these are registered in sprout core for core tables.
Table of Contents
Interfaces
- FindReplaceInterface
- This is a base class for find-replace behaviours, aka. the doomtool.
Properties
Methods
- __construct() : mixed
- find() : iterable<string|int, array<string|int, mixed>>
- Find all occurrences of the the given string patterns.
- getName() : string
- The friendly name for this doomtool shown in the dbtools.
- key() : string
- The unique key for this doomtool.
- replace() : int
- Find and replace all occurrences of the given string patterns.
Properties
$column
public
string
$column
$table
public
string
$table
Methods
__construct()
public
__construct(string $table, string $column) : mixed
Parameters
- $table : string
- $column : string
Tags
find()
Find all occurrences of the the given string patterns.
public
find(array<string|int, mixed> $finds, array<string|int, mixed> $settings) : iterable<string|int, array<string|int, mixed>>
Parameters
- $finds : array<string|int, mixed>
-
regex patterns
- $settings : array<string|int, mixed>
-
[ ignore_case ]
Tags
Return values
iterable<string|int, array<string|int, mixed>> —[ id, key, text, url, indexes, count ]
getName()
The friendly name for this doomtool shown in the dbtools.
public
getName() : string
Tags
Return values
stringkey()
The unique key for this doomtool.
public
key() : string
Tags
Return values
stringreplace()
Find and replace all occurrences of the given string patterns.
public
replace(array<string|int, mixed> $replaces, array<string|int, mixed> $settings) : int
Parameters
- $replaces : array<string|int, mixed>
-
[ find => replace ] regex + replacements
- $settings : array<string|int, mixed>
-
[ ignore_case ]
Tags
Return values
int —number of replacements