You are here

public function FrxSyntaxEngine::__construct in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 FrxSyntaxEngine.inc \FrxSyntaxEngine::__construct()
  2. 6 FrxSyntaxEngine.inc \FrxSyntaxEngine::__construct()
  3. 7 FrxSyntaxEngine.inc \FrxSyntaxEngine::__construct()
  4. 7.2 FrxSyntaxEngine.inc \FrxSyntaxEngine::__construct()
  5. 7.3 FrxSyntaxEngine.inc \FrxSyntaxEngine::__construct()

Class for doing syntax replacements;

Parameters

string $regexp:

string $trim: Trim characters

object $data: Data object to be used for resolving contexts.

$formatter: Field formatter used to format fields

$data: Data used to perform the replacement on.

File

./FrxSyntaxEngine.inc, line 30
FrXSytnaxEngine defines how regular expression procesing/token substitution takes place. It includes support for passing in a formatter oobject that will escape strings properly before substituting them.

Class

FrxSyntaxEngine
@file FrXSytnaxEngine defines how regular expression procesing/token substitution takes place. It includes support for passing in a formatter oobject that will escape strings properly before substituting them.

Code

public function __construct($regexp, $trim, $formatter = NULL, $data = NULL) {
  $this->tpattern = $regexp;
  $this->trim_chars = $trim;
  if (is_object($formatter)) {
    $this->formatter = $formatter;
  }
  if ($data) {
    $this->data = $data;
  }
  else {
    $this->data = Frx::Data();
  }
}