Added brands feed processing

This commit is contained in:
Franck Allimant
2014-06-30 20:13:14 +02:00
parent dc63498180
commit 30afbf1433

View File

@@ -18,6 +18,7 @@ use Thelia\Controller\Front\BaseFrontController;
use Thelia\Core\HttpFoundation\Request; use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Response; use Thelia\Core\HttpFoundation\Response;
use Thelia\Log\Tlog; use Thelia\Log\Tlog;
use Thelia\Model\BrandQuery;
use Thelia\Model\FolderQuery; use Thelia\Model\FolderQuery;
use Thelia\Model\CategoryQuery; use Thelia\Model\CategoryQuery;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
@@ -56,6 +57,7 @@ class FeedController extends BaseFrontController {
* @param $id string The id of the parent element. The id of the main parent category for catalog context. * @param $id string The id of the parent element. The id of the main parent category for catalog context.
* The id of the content folder for content context * The id of the content folder for content context
* @return Response * @return Response
* @throws \RuntimeException
*/ */
public function generateAction($context, $lang, $id) public function generateAction($context, $lang, $id)
{ {
@@ -66,7 +68,7 @@ class FeedController extends BaseFrontController {
// context // context
if ("" === $context){ if ("" === $context){
$context = "catalog"; $context = "catalog";
} else if (! in_array($context, array("catalog", "content")) ){ } else if (! in_array($context, array("catalog", "content", "brand")) ){
$this->pageNotFound(); $this->pageNotFound();
} }
@@ -189,6 +191,9 @@ class FeedController extends BaseFrontController {
if ("catalog" === $context){ if ("catalog" === $context){
$cat = CategoryQuery::create()->findPk($id); $cat = CategoryQuery::create()->findPk($id);
$ret = (null !== $cat && $cat->getVisible()); $ret = (null !== $cat && $cat->getVisible());
} elseif ("brand" === $context) {
$brand = BrandQuery::create()->findPk($id);
$ret = (null !== $brand && $brand->getVisible());
} else { } else {
$folder = FolderQuery::create()->findPk($id); $folder = FolderQuery::create()->findPk($id);
$ret = (null !== $folder && $folder->getVisible()); $ret = (null !== $folder && $folder->getVisible());
@@ -196,5 +201,4 @@ class FeedController extends BaseFrontController {
} }
return $ret; return $ret;
} }
} }