AbstractController::getExistingObject return object with hte needed
locale inside
This commit is contained in:
@@ -156,9 +156,14 @@ class CategoryController extends AbstractSeoCrudController
|
||||
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return CategoryQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('category_id', 0));
|
||||
$category = CategoryQuery::create()
|
||||
->findOneById($this->getRequest()->get('category_id', 0));
|
||||
|
||||
if (null !== $category) {
|
||||
$category->setLocale($this->getCurrentEditionLocale());
|
||||
}
|
||||
|
||||
return $category;
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object)
|
||||
|
||||
@@ -236,9 +236,13 @@ class ContentController extends AbstractSeoCrudController
|
||||
*/
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return ContentQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
$content = ContentQuery::create()
|
||||
->findOneById($this->getRequest()->get('content_id', 0));
|
||||
|
||||
if (null !== $content) {
|
||||
$content->setLocale($this->getCurrentEditionLocale());
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -199,9 +199,13 @@ class FolderController extends AbstractSeoCrudController
|
||||
*/
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return FolderQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
$folder = FolderQuery::create()
|
||||
->findOneById($this->getRequest()->get('folder_id', 0));
|
||||
|
||||
if (null !== $folder) {
|
||||
$folder->setLocale($this->getCurrentEditionLocale());
|
||||
}
|
||||
return $folder;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -343,9 +343,14 @@ class ProductController extends AbstractSeoCrudController
|
||||
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return ProductQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('product_id', 0));
|
||||
$product = ProductQuery::create()
|
||||
->findOneById($this->getRequest()->get('product_id', 0));
|
||||
|
||||
if (null !== $product) {
|
||||
$product->setLocale($this->getCurrentEditionLocale());
|
||||
}
|
||||
|
||||
return $product;
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object)
|
||||
|
||||
Reference in New Issue
Block a user