From: Gustavo Martin Morcuende Date: Sun, 2 Dec 2012 04:55:53 +0000 (+0100) Subject: Return ads depends on user's language X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=d69b4dc49aa58102f22735dc5f5b5b02b57c15e7;p=mobi%2F.git Return ads depends on user's language If there are not ad with his/hes language, do not return anything. --- diff --git a/lib/model/doctrine/AdDescriptionTable.class.php b/lib/model/doctrine/AdDescriptionTable.class.php index 42ad61e..d21111c 100644 --- a/lib/model/doctrine/AdDescriptionTable.class.php +++ b/lib/model/doctrine/AdDescriptionTable.class.php @@ -129,19 +129,6 @@ class AdDescriptionTable extends Doctrine_Table { $ads[] = $ad; } - else - { - //Return with the default language - $languageCode = sfConfig::get('app_default_language'); - $languageId = LanguageTable::getInstance()->findOneByCode($languageCode)->getId(); - $ad = $this->findOneByAdIdAndLanguageId($adId, $languageId); - //This should never happen if every ad has at least the language by default. - //TODO: Do not let the users create ads without the default language. - if ($ad != null) - { - $ads[] = $ad; - } - } } return $ads; }