作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在构建模型时收到此错误消息:
When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name "attribute" ...
product_attribute: { name: product_attribute as attribute, type: clob(16777777) }
ATTR_AUTO_ACCESSOR_OVERRIDE
关闭或我有问题。如果可以,我该怎么做?
ATTR_AUTO_ACCESSOR_OVERRIDE
离开?如果有一个(或多个),它会是什么?
@property clob $product_attribute
JosVmProduct:
columns:
product_id: { type: int, notnull: true, unique: true, primary: true, autoincrement: true }
vendor_id: { type: int, notnull: true, default: 0 }
product_parent_id: { type: int, notnull: true, default: 0 }
product_sku: { type: string(64), , notnull: true, default: '' }
product_s_desc: { type: string(255), default: null }
product_desc: { type: clob(16777777) }
product_thumb_image: { type: string(255), default: null }
product_full_image: { type: string(255), default: null }
product_publish: { type: string(1), default: null }
product_weight: { type: decimal(10), scale: 4, default: null }
product_weight_uom: { type: string(32), default: 'pounds.' }
product_length: { type: decimal(10), scale: 4, default: null }
product_width: { type: decimal(10), scale: 4, default: null }
product_height: { type: decimal(10), scale: 4, default: null }
product_lwh_uom: { type: string(32), default: 'inches' }
product_url: { type: string(255), default: null }
product_in_stock: { type: int, default: null }
product_available_date: { type: int, default: null }
product_availability: { type: string(56), notnull: true, default: '' }
product_special: { type: string(1), default: null }
product_discount_id: { type: int, default: null }
ship_code_id: { type: int, default: null }
cdate: { type: int, default: null }
mdate: { type: int, default: null }
product_name: { type: string(64), default: null }
product_sales: { type: int, notnull: true, default 0 }
product_attribute: { name: product_attribute as attribute, type: clob(16777777) }
custom_attribute: { type: clob(16777777), notnull: true }
product_tax_id: { type: int(2), notnull: true, default: '0' }
product_unit: { type: string(32), default: null }
product_packaging: { type: int, default: null }
webinar_duration: { type: string(50), default: null }
最佳答案
我找到了更好的解决方案,把它放在 ProjectConfiguration 类中:
public function configureDoctrine()
{
$isCli = (php_sapi_name() == "cli");
if(true == $isCli)
{
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, false);
}
}
关于symfony1 - ATTR_AUTO_ACCESSOR_OVERRIDE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7266293/
我在构建模型时收到此错误消息: When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name "
我是一名优秀的程序员,十分优秀!