Macro
Less than 1 minute
Macro
Represents a macro for dynamic value lookup in database synchronization.
class Macro extends \Hazaar\DBI\Manager\Sync\StructEncapsulates table, field, and criteria for macro expansion and provides methods for matching and executing macros.
Properties
table
The name of the table to perform the macro lookup on.
public string $tablefield
The field to retrieve from the table.
public string $fieldcriteria
public array $criteriaindexKey
The unique index key for caching macro lookups.
public string $indexKeylookups
private $lookupsMethods
__toString
Returns the string representation of the macro.
public __toString(): stringconstructed
Initializes the macro after construction, generating the index key.
public constructed(): voidMatches a macro pattern in a string and returns a Macro instance if found.
public (string $field): ?selfParameters
| Parameter | Type | Description |
|---|---|---|
$field | string | the string to match against the macro pattern |
run
Executes the macro, performing a lookup in the database and caching the result.
public run(Adapter $dbi): mixedParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
prepareCriteria
private prepareCriteria(string $value): voidParameters
| Parameter | Type | Description |
|---|---|---|
$value | string |
prepareCriteriaItem
private prepareCriteriaItem(string $criteria): voidParameters
| Parameter | Type | Description |
|---|---|---|
$criteria | string |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000