Fixed error: finding ads but not user association.
authorGusa <gu.martinm@gmail.com>
Sat, 15 Dec 2012 02:54:17 +0000 (03:54 +0100)
committerGusa <gu.martinm@gmail.com>
Sat, 15 Dec 2012 02:54:17 +0000 (03:54 +0100)
lib/model/doctrine/AdDescriptionTable.class.php

index d21111c..eaa69cb 100644 (file)
@@ -102,7 +102,7 @@ class AdDescriptionTable extends Doctrine_Table
         {
             try
             {
-                $adIds[] = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne(
+                $auxAdId = Doctrine_Manager::getInstance()->getCurrentConnection()->fetchOne(
                     "SELECT ad.id FROM ad INNER JOIN company_category ON (ad.company_categ_id=company_category.id)
                     INNER JOIN general_category ON (company_category.general_categ_id=general_category.id)
                     INNER JOIN user_basket ON (user_basket.general_categ_id=general_category.id)
@@ -114,6 +114,11 @@ class AdDescriptionTable extends Doctrine_Table
                 //In case of error return as soon as posible.
                 return null;
             }
+
+            if (!empty($auxAdId))
+            {
+                $adIds[] = $auxAdId;
+            }
         }
         if (empty($adIds))
         {