This commit is contained in:
parent
adc6c1b22a
commit
49574ce956
@ -132,7 +132,8 @@ class Doctrine_Hook
|
|||||||
list($alias, $column) = $e;
|
list($alias, $column) = $e;
|
||||||
|
|
||||||
$tableAlias = $this->query->getTableAlias($alias);
|
$tableAlias = $this->query->getTableAlias($alias);
|
||||||
$table = $this->query->getTable($tableAlias);
|
$map = $this->query->getAliasDeclaration($alias);
|
||||||
|
$table = $map['table'];
|
||||||
|
|
||||||
if ( ! $table) {
|
if ( ! $table) {
|
||||||
throw new Doctrine_Exception('Unknown table alias ' . $tableAlias);
|
throw new Doctrine_Exception('Unknown table alias ' . $tableAlias);
|
||||||
@ -181,7 +182,8 @@ class Doctrine_Hook
|
|||||||
list($alias, $column) = $e;
|
list($alias, $column) = $e;
|
||||||
|
|
||||||
$tableAlias = $this->query->getTableAlias($alias);
|
$tableAlias = $this->query->getTableAlias($alias);
|
||||||
$table = $this->query->getTable($tableAlias);
|
$map = $this->query->getAliasDeclaration($alias);
|
||||||
|
$table = $map['table'];
|
||||||
|
|
||||||
if ($def = $table->getDefinitionOf($column)) {
|
if ($def = $table->getDefinitionOf($column)) {
|
||||||
$this->query->addOrderBy($alias . '.' . $column . ' ' . $order);
|
$this->query->addOrderBy($alias . '.' . $column . ' ' . $order);
|
||||||
|
@ -58,7 +58,7 @@ abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser
|
|||||||
*/
|
*/
|
||||||
public function parseClause($alias, $field, $value)
|
public function parseClause($alias, $field, $value)
|
||||||
{
|
{
|
||||||
$parts = Doctrine_Query::quoteExplode($value, ' AND ');
|
$parts = Doctrine_Tokenizer::quoteExplode($value, ' AND ');
|
||||||
|
|
||||||
if (count($parts) > 1) {
|
if (count($parts) > 1) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@ -68,7 +68,7 @@ abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser
|
|||||||
|
|
||||||
$r = implode(' AND ', $ret);
|
$r = implode(' AND ', $ret);
|
||||||
} else {
|
} else {
|
||||||
$parts = Doctrine_Query::quoteExplode($value, ' OR ');
|
$parts = Doctrine_Tokenizer::quoteExplode($value, ' OR ');
|
||||||
if (count($parts) > 1) {
|
if (count($parts) > 1) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
foreach ($parts as $part) {
|
foreach ($parts as $part) {
|
||||||
|
@ -47,7 +47,7 @@ class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex
|
|||||||
public function parseSingle($alias, $field, $value)
|
public function parseSingle($alias, $field, $value)
|
||||||
{
|
{
|
||||||
if (strpos($value, "'") !== false) {
|
if (strpos($value, "'") !== false) {
|
||||||
$value = Doctrine_Query::bracketTrim($value, "'", "'");
|
$value = Doctrine_Tokenizer::bracketTrim($value, "'", "'");
|
||||||
|
|
||||||
$a[] = $alias . '.' . $field . ' LIKE ?';
|
$a[] = $alias . '.' . $field . ' LIKE ?';
|
||||||
$this->params[] = $value . '%';
|
$this->params[] = $value . '%';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user