【发布时间】:2018-11-19 07:36:36
【问题描述】:
这是我的类文件 Country.php
<?php
namespace App\Entity;
use Sylius\Component\Addressing\Model\Country as BaseCountry;
class Country extends BaseCountry {
/**
* @var bool
*/
private $flag;
/**
* @return bool|null
*/
public function getFlag(): ?bool {
return $this->flag;
}
/**
* @param bool $flag
*/
public function setFlag(bool $flag): void {
$this->flag = $flag;
}
}
这是我的 orm 文件。 AppBundle/Resources/config/doctrine/Country.orm.yml
App\Entity\Country:
type: entity
table: sylius_country
fields:
flag:
type: boolean
nullable: true
这是我的配置文件。 config/_sylius.yml
sylius_addressing:
resources:
country:
classes:
model: App\Entity\Country
这一切都像 sylius 自定义模型一样好,但它不起作用。
【问题讨论】:
-
您使用哪个版本的 Sylius?请更明确。究竟什么是“不工作”?
-
我使用的是 sylius 1.3 版本。?扩展的 sylius 自定义模型不起作用。
标签: php frameworks symfony4 sylius sylius-1.3