Closed GServices228 closed 2 weeks ago
Hi @GServices228. Can you share the ProductRepository file?
Hello,thanks for the prompt reply. Here is the content:
<?php
// src/Repository/ProductRepository.php
// ...
use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryInterface;
use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryTrait;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;
class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface
{
use ProductRepositoryTrait;
// ...
}`
You forgot to add the namespace of this file
oh thanks @bigboss86 .what it suppose to be? Because the Directory and the file were not present so i've created them manually. following the Product namespace,i've modified it as: `<?php
declare(strict_types=1);
namespace App\Repository\ProductRepository;
use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryInterface; use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryTrait; use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;
class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface { use ProductRepositoryTrait;
// ...
}` Running the command return same problem. What else should i do please.
Should be "App\Repository"
<?php
declare(strict_types=1);
namespace App\Repository;
use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryInterface;
use Odiseo\SyliusVendorPlugin\Repository\ProductRepositoryTrait;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;
class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface
{
use ProductRepositoryTrait;
}
Thanks @bigboss86. worked now.
Hello,Hope everything is well. I'm following the guide to install the plugin but i'm getting this `error Symfony\Component\ErrorHandler\Error\FatalError^ {#7876
message: "Compile Error: Cannot declare class ProductRepository, because the name is already in use"
code: 0
file: "./src/Repository/ProductRepository.php"
line: 9
-error: array:4 [ "type" => 64 "message" => "Cannot declare class ProductRepository, because the name is already in use" "file" => "/www/wwwroot/app.germinalservices.com/goteach/src/Repository/ProductRepository.php" "line" => 9 ] } ` every time.when trying php bin/console doctrine:migrations:migrate.
Actions i took: -Modify the class name in "src/Repository/ProductRepository.php" and config/packages/_sylius.yaml -restarted from top but it still blocking there.
Any help will be appreciated.Thanks in advance