Php Sylius覆盖的ShopUser模型
我想覆盖SyliusScoreBundle的shop_用户模型,我遵循了,但有两个问题Php Sylius覆盖的ShopUser模型,php,symfony,sylius,Php,Symfony,Sylius,我想覆盖SyliusScoreBundle的shop_用户模型,我遵循了,但有两个问题 在配置文件中,当我使用“sylius_shop_user”作为表名时, 它说这个表已经存在了具有名称的表 “sylius_dev.sylius_shop_user”已存在。 当我想要覆盖shop\u用户模型的类时,我会遇到以下错误:无法识别的选项“sylius\u core.resources”下的“shop\u user” 这是我对1.0.0-alpha.1的配置:) ShopUser.php namesp
无法识别的选项“sylius\u core.resources”下的“shop\u user”
这是我对1.0.0-alpha.1的配置:) ShopUser.php
namespace AppBundle\Entity;
use Sylius\Component\Core\Model\ShopUser as BaseShopUser;
class ShopUser extends BaseShopUser implements ShopUserInterface {...}
ShopUserInterface.php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Core\Model\ShopUserInterface as BaseShopUserInterface;
interface ShopUserInterface extends BaseShopUserInterface {...}
namespace AppBundle\Entity\Repository;
use Sylius\Component\User\Repository\UserRepositoryInterface;
interface ShopUserRepositoryInterface extends UserRepositoryInterface {...}
ShopUserRepository.php
namespace AppBundle\Entity\Repository;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\UserRepository as BaseUserRepository;
class ShopUserRepository extends BaseUserRepository implements ShopUserRepositoryInterface {...}
ShopUserRepositoryInterface.php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Core\Model\ShopUserInterface as BaseShopUserInterface;
interface ShopUserInterface extends BaseShopUserInterface {...}
namespace AppBundle\Entity\Repository;
use Sylius\Component\User\Repository\UserRepositoryInterface;
interface ShopUserRepositoryInterface extends UserRepositoryInterface {...}
/src/AppBundle/Resources/config/doctor/ShopUser.orm.xml
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="AppBundle\Entity\ShopUser" table="sylius_shop_user" repository-class="AppBundle\Entity\Repository\ShopUserRepository">
...
</entity>
</doctrine-mapping>
这是我对1.0.0-alpha.1的配置:) ShopUser.php
namespace AppBundle\Entity;
use Sylius\Component\Core\Model\ShopUser as BaseShopUser;
class ShopUser extends BaseShopUser implements ShopUserInterface {...}
ShopUserInterface.php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Core\Model\ShopUserInterface as BaseShopUserInterface;
interface ShopUserInterface extends BaseShopUserInterface {...}
namespace AppBundle\Entity\Repository;
use Sylius\Component\User\Repository\UserRepositoryInterface;
interface ShopUserRepositoryInterface extends UserRepositoryInterface {...}
ShopUserRepository.php
namespace AppBundle\Entity\Repository;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\UserRepository as BaseUserRepository;
class ShopUserRepository extends BaseUserRepository implements ShopUserRepositoryInterface {...}
ShopUserRepositoryInterface.php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Core\Model\ShopUserInterface as BaseShopUserInterface;
interface ShopUserInterface extends BaseShopUserInterface {...}
namespace AppBundle\Entity\Repository;
use Sylius\Component\User\Repository\UserRepositoryInterface;
interface ShopUserRepositoryInterface extends UserRepositoryInterface {...}
/src/AppBundle/Resources/config/doctor/ShopUser.orm.xml
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="AppBundle\Entity\ShopUser" table="sylius_shop_user" repository-class="AppBundle\Entity\Repository\ShopUserRepository">
...
</entity>
</doctrine-mapping>