Merging fixes and enhancements into trunk

Revision: [1850]
Added fix for duplicate alias name being added to fields passed the the Model methods,
when a field already was aliased Example: Post.id will no longer return Post.Post.id.

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1851 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-01-21 00:09:27 +00:00
parent 2407160dc5
commit 660259640d
2 changed files with 11 additions and 2 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.7.1849 RC 2
0.10.7.1851 RC 3

View file

@ -907,7 +907,16 @@ class DboSource extends DataSource
{
for ($i = 0; $i < $count; $i++)
{
$fields[$i] = $this->name($alias).'.'.$this->name($fields[$i]);
$dot = strrpos($fields[$i], '.');
if ($dot === false)
{
$fields[$i] = $this->name($alias).'.'.$this->name($fields[$i]);
}
else
{
$build = explode('.',$fields[$i]);
$fields[$i] = $this->name($build[0]).'.'.$this->name($build[1]);
}
}
}
return $fields;