mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merging fixes and enhancements into trunk
Revision: [1845] Adding changes to DboSource::generateAssociationQuery and DboSource::conditions() noted in Ticket #301. git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1846 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
48c9bb3bbd
commit
c56189ac5c
2 changed files with 12 additions and 7 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.7.1844 RC 2
|
||||
0.10.7.1846 RC 2
|
|
@ -705,21 +705,21 @@ class DboSource extends DataSource
|
|||
$sql = 'SELECT '.join(', ', $this->fields($linkModel, $alias, $assocData['fields']));
|
||||
$sql .= ' FROM '.$this->name($linkModel->table).' AS '. $this->name($alias);
|
||||
|
||||
$cond = $this->name($alias).'.'.$this->name($assocData['foreignKey']);
|
||||
$cond .= '={$__cake_id__$}';
|
||||
if (is_array($conditions))
|
||||
{
|
||||
$conditions[] = $cond;
|
||||
$conditions[$alias.'.'.$assocData['foreignKey']] = '{$__cake_id__$}';
|
||||
}
|
||||
else
|
||||
{
|
||||
$cond = $this->name($alias).'.'.$this->name($assocData['foreignKey']);
|
||||
$cond .= '={$__cake_id__$}';
|
||||
|
||||
if (trim($conditions) != '')
|
||||
{
|
||||
$conditions .= ' AND ';
|
||||
}
|
||||
$conditions .= $cond;
|
||||
}
|
||||
|
||||
$sql .= $this->conditions($conditions);
|
||||
$sql .= $this->order($assocData['order']);
|
||||
}
|
||||
|
@ -953,7 +953,12 @@ class DboSource extends DataSource
|
|||
}
|
||||
else
|
||||
{
|
||||
$slashedValue = $this->value($value);
|
||||
if (($value != '{$__cake_id__$}') && ($value != '{$__cake_foreignKey__$}'))
|
||||
{
|
||||
$value = $this->value($value);
|
||||
}
|
||||
|
||||
//$slashedValue = $this->value($value);
|
||||
//TODO: Remove the = below so LIKE and other compares can be used
|
||||
$data = $key . '=';
|
||||
if ($value === null)
|
||||
|
@ -962,7 +967,7 @@ class DboSource extends DataSource
|
|||
}
|
||||
else
|
||||
{
|
||||
$data .= $slashedValue;
|
||||
$data .= $value;
|
||||
}
|
||||
}
|
||||
$out[] = $data;
|
||||
|
|
Loading…
Reference in a new issue