Inherits Doctrine_Hook_Parser_Complex.
Definition at line 33 of file Integer.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_Integer::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 Integer.php.
{
$e = explode(' ', $value);
foreach ($e as $v) {
$v = trim($v);
$e2 = explode('-', $v);
$name = $alias. '.' . $field;
if (count($e2) == 1) {
$a[] = $name . ' = ?';
$this->params[] = $v;
} else {
$a[] = '(' . $name . ' > ? AND ' . $name . ' < ?)';
$this->params += array($e2[0], $e2[1]);
}
}
return implode(' OR ', $a);
}
The documentation for this class was generated from the following file: