Fixing notices generated by new HABTM features

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3213 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-07-07 15:29:55 +00:00
parent af18379343
commit 4e183bf492

View file

@ -1033,7 +1033,7 @@ class DboSource extends DataSource {
}
$joinFields = array();
if (isset($assocData['with'])) {
if (isset($assocData['with']) && !empty($assocData['with'])) {
$joinName = array_keys($assocData['with']);
$joinFields = $assocData['with'][$joinName[0]];
@ -1049,7 +1049,7 @@ class DboSource extends DataSource {
$sql .= ' JOIN ' . $joinTbl;
$joinAssoc = $joinTbl;
if (isset($assocData['with'])) {
if (isset($assocData['with']) && !empty($assocData['with'])) {
$joinAssoc = $joinName[0];
$sql .= $this->alias . $this->name($joinAssoc);
}