Inherits Doctrine_Hook_Parser_Complex.
Definition at line 33 of file WordLike.php.
| Doctrine_Hook_Parser::getParams |
( |
| ) |
|
|
inherited |
getParams returns the parameters associated with this parser
- Returns
- array
Definition at line 49 of file Parser.php.
{
return $this->params;
}
| Doctrine_Hook_Parser_Complex::parse |
( |
|
$alias, |
|
|
|
$field, |
|
|
|
$value |
|
) |
| |
|
inherited |
parse Parses given field and field value to DQL condition and parameters. This method should always return prepared statement conditions (conditions that use placeholders instead of literal values).
- Parameters
-
| string | $alias | component alias |
| string | $field | the field name |
| mixed | $value | the value of the field |
- Returns
- void
Definition at line 57 of file Complex.php.
{
$this->condition = $this->
parseClause($alias, $field, $value);
}
| Doctrine_Hook_Parser_Complex::parseClause |
( |
|
$alias, |
|
|
|
$field, |
|
|
|
$value |
|
) |
| |
|
inherited |
parseClause
- Parameters
-
| string | $alias | component alias |
| string | $field | the field name |
| mixed | $value | the value of the field |
- Returns
- void
Definition at line 70 of file Complex.php.
{
$parts = $this->_tokenizer->quoteExplode($value, ' AND ');
if (count($parts) > 1) {
$ret = array();
foreach ($parts as $part) {
}
$r = implode(' AND ', $ret);
} else {
$parts = $this->_tokenizer->quoteExplode($value, ' OR ');
if (count($parts) > 1) {
$ret = array();
foreach ($parts as $part) {
}
$r = implode(' OR ', $ret);
} else {
return $ret;
}
}
return '(' . $r . ')';
}
| Doctrine_Hook_WordLike::parseSingle |
( |
|
$alias, |
|
|
|
$field, |
|
|
|
$value |
|
) |
| |
parse Parses given field and field value to DQL condition and parameters. This method should always return prepared statement conditions (conditions that use placeholders instead of literal values).
- Parameters
-
| string | $alias | component alias |
| string | $field | the field name |
| mixed | $value | the value of the field |
- Returns
- void
Definition at line 47 of file WordLike.php.
{
if (strpos($value, "'") !== false) {
$value = $this->_tokenizer->bracketTrim($value, "'", "'");
$a[] = $alias . '.' . $field . ' LIKE ?';
$this->params[] = '%' . $value . '%';
} else {
$e2 = explode(' ',$value);
foreach ($e2 as $v) {
$v = trim($v);
$a[] = $alias . '.' . $field . ' LIKE ?';
$this->params[] = '%' . $v . '%';
}
}
return implode(' OR ', $a);
}
The documentation for this class was generated from the following file: