Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrade plugin related product for ec-cube 4.2 #83

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Controller/Admin/RelatedProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Controller\Admin;
namespace Plugin\RelatedProduct42\Controller\Admin;

use Eccube\Controller\AbstractController;
use Eccube\Repository\CategoryRepository;
Expand Down Expand Up @@ -69,7 +69,7 @@ public function __construct(
* @Route("/%eccube_admin_route%/related_product/search/product", name="admin_related_product_search")
* @Route("/%eccube_admin_route%/related_product/search/product/page/{page_no}", name="admin_related_product_search_product_page", requirements={"page_no":"\d+"})
*
* @Template("@RelatedProduct4/admin/modal_result.twig")
* @Template("@RelatedProduct42/admin/modal_result.twig")
*/
public function searchProduct(Request $request, $page_no = null)
{
Expand Down
4 changes: 2 additions & 2 deletions Entity/ProductTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Entity;
namespace Plugin\RelatedProduct42\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
Expand All @@ -25,7 +25,7 @@ trait ProductTrait
/**
* @var RelatedProduct[]|Collection
*
* @ORM\OneToMany(targetEntity="Plugin\RelatedProduct4\Entity\RelatedProduct", mappedBy="Product", cascade={"persist", "remove"})
* @ORM\OneToMany(targetEntity="Plugin\RelatedProduct42\Entity\RelatedProduct", mappedBy="Product", cascade={"persist", "remove"})
* @ORM\OrderBy({
* "id"="ASC"
* })
Expand Down
4 changes: 2 additions & 2 deletions Entity/RelatedProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Entity;
namespace Plugin\RelatedProduct42\Entity;

use Eccube\Entity\AbstractEntity;
use Eccube\Entity\Product;
Expand All @@ -21,7 +21,7 @@
* Class RelatedProduct.
*
* @ORM\Table(name="plg_related_product")
* @ORM\Entity(repositoryClass="Plugin\RelatedProduct4\Repository\RelatedProductRepository")
* @ORM\Entity(repositoryClass="Plugin\RelatedProduct42\Repository\RelatedProductRepository")
*/
class RelatedProduct extends AbstractEntity
{
Expand Down
8 changes: 4 additions & 4 deletions Form/Extension/Admin/RelatedCollectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Form\Extension\Admin;
namespace Plugin\RelatedProduct42\Form\Extension\Admin;

use Doctrine\ORM\EntityManagerInterface;
use Eccube\Common\EccubeConfig;
use Eccube\Entity\Product;
use Eccube\Form\Type\Admin\ProductType;
use Plugin\RelatedProduct4\Entity\RelatedProduct;
use Plugin\RelatedProduct4\Form\Type\Admin\RelatedProductType;
use Plugin\RelatedProduct42\Entity\RelatedProduct;
use Plugin\RelatedProduct42\Form\Type\Admin\RelatedProductType;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -105,7 +105,7 @@ public function getExtendedType()
*
* @return string[]
*/
public static function getExtendedTypes()
public static function getExtendedTypes(): iterable
{
yield ProductType::class;
}
Expand Down
4 changes: 2 additions & 2 deletions Form/Type/Admin/RelatedProductType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Form\Type\Admin;
namespace Plugin\RelatedProduct42\Form\Type\Admin;

use Doctrine\ORM\EntityManagerInterface;
use Eccube\Common\EccubeConfig;
use Eccube\Entity\Product;
use Eccube\Form\DataTransformer\EntityToIdTransformer;
use Plugin\RelatedProduct4\Entity\RelatedProduct;
use Plugin\RelatedProduct42\Entity\RelatedProduct;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
Expand Down
2 changes: 1 addition & 1 deletion PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4;
namespace Plugin\RelatedProduct42;

use Eccube\Plugin\AbstractPluginManager;

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 関連商品プラグイン

[![CI for RelatedProduct4](https://github.com/EC-CUBE/related-product-plugin/actions/workflows/main.yml/badge.svg)](https://github.com/EC-CUBE/related-product-plugin/actions/workflows/main.yml)
[![CI for RelatedProduct42](https://github.com/EC-CUBE/related-product-plugin/actions/workflows/main.yml/badge.svg)](https://github.com/EC-CUBE/related-product-plugin/actions/workflows/main.yml)

## 概要
商品詳細ページに、関連する商品を表示できるようになるプラグイン。
Expand Down
6 changes: 3 additions & 3 deletions RelatedProductEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4;
namespace Plugin\RelatedProduct42;

use Eccube\Event\TemplateEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand All @@ -33,7 +33,7 @@ public static function getSubscribedEvents()
*/
public function onRenderProductDetail(TemplateEvent $event)
{
$event->addSnippet('@RelatedProduct4/front/related_product.twig');
$event->addSnippet('@RelatedProduct42/front/related_product.twig');
}

/**
Expand All @@ -43,6 +43,6 @@ public function onRenderProductDetail(TemplateEvent $event)
*/
public function onRenderAdminProduct(TemplateEvent $event)
{
$event->addSnippet('@RelatedProduct4/admin/related_product.twig');
$event->addSnippet('@RelatedProduct42/admin/related_product.twig');
}
}
6 changes: 3 additions & 3 deletions Repository/RelatedProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
* file that was distributed with this source code.
*/

namespace Plugin\RelatedProduct4\Repository;
namespace Plugin\RelatedProduct42\Repository;

use Eccube\Repository\AbstractRepository;
use Plugin\RelatedProduct4\Entity\RelatedProduct;
use Doctrine\Common\Persistence\ManagerRegistry;
use Plugin\RelatedProduct42\Entity\RelatedProduct;
use Doctrine\Persistence\ManagerRegistry;

/**
* RelatedProductRepository.
Expand Down
6 changes: 3 additions & 3 deletions Tests/Web/RelatedProductAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace Plugin\RelatedProduct\Tests\Web;

use Eccube\Tests\Web\Admin\AbstractAdminWebTestCase;
use Plugin\RelatedProduct4\Entity\RelatedProduct;
use Plugin\RelatedProduct42\Entity\RelatedProduct;
use Eccube\Repository\ProductRepository;
use Plugin\RelatedProduct4\Repository\RelatedProductRepository;
use Plugin\RelatedProduct42\Repository\RelatedProductRepository;
use Eccube\Entity\Master\ProductStatus;
use Eccube\Repository\Master\ProductStatusRepository;
use Eccube\Common\Constant;
Expand Down Expand Up @@ -56,7 +56,7 @@ class RelatedProductAdminControllerTest extends AbstractAdminWebTestCase
/**
* call parent setUp.
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->deleteAllRows(['plg_related_product']);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Web/RelatedProductControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Plugin\RelatedProduct\Tests\Web;

use Eccube\Tests\Web\AbstractWebTestCase;
use Plugin\RelatedProduct4\Entity\RelatedProduct;
use Plugin\RelatedProduct42\Entity\RelatedProduct;
use Eccube\Repository\ProductRepository;
use Eccube\Entity\Product;

Expand All @@ -36,7 +36,7 @@ class RelatedProductControllerTest extends AbstractWebTestCase
/**
* {@inheritdoc}
*/
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "ec-cube/relatedproduct4",
"version": "4.1.0",
"name": "ec-cube/relatedproduct42",
"version": "4.2.0",
"description": "関連商品プラグイン",
"type": "eccube-plugin",
"require": {
"ec-cube/plugin-installer": "~0.0.6 || ^2.0"
"ec-cube/plugin-installer": "^2.0"
},
"extra": {
"code": "RelatedProduct4"
"code": "RelatedProduct42"
}
}