Macro
Macro
Represents a macro for dynamic value lookup in database synchronization.
class Macro extends \Hazaar\Model\StructExtends: Hazaar\Model\Struct
Encapsulates 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 $tableType: string
field
The field to retrieve from the table.
public string $fieldType: string
criteria
public array $criteriaType: array
indexKey
The unique index key for caching macro lookups.
public string $indexKeyType: string
lookups
private $lookupsMethods
__toString
Returns the string representation of the macro.
public __toString(): stringReturns: string
constructed
Initializes the macro after construction, generating the index key.
public constructed(): voidReturns: void
Matches a macro pattern in a string and returns a Macro instance if found.
public (string $field): ?selfReturns: self
Parameters
| 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): mixedReturns: mixed
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
prepareCriteria
private prepareCriteria(string $value): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string |
prepareCriteriaItem
private prepareCriteriaItem(string $criteria): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$criteria | string |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000