From d69b4dc49aa58102f22735dc5f5b5b02b57c15e7 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 2 Dec 2012 05:55:53 +0100 Subject: [PATCH] Return ads depends on user's language If there are not ad with his/hes language, do not return anything. --- lib/model/doctrine/AdDescriptionTable.class.php | 13 ------------- 1 file changed, 13 deletions(-) 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; } -- 2.1.4