ATTR_AUTO_ACCESSOR_OVERRIDE

I get this error message when creating a model:

When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name "attribute" ...

The problem is that I have to use this field name because it is in the table that is created and used by virtuemart. The alias also does not work.

product_attribute: { name: product_attribute as attribute,  type: clob(16777777) }

So what can I do? Can I disconnect ATTR_AUTO_ACCESSOR_OVERRIDEor am I having problems with this. In case I can, how can I do this?

May have a shutdown problem ATTR_AUTO_ACCESSOR_OVERRIDE? And if there is one (or more), what will it be?

I am grateful for any advice!


Additional Information:

Definition in BaseJosVmProduct: @property clob $product_attribute

schema.yml:

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 }
+5
source share
2 answers

, ProjectConfiguration:

public function configureDoctrine()
        {
        $isCli = (php_sapi_name() == "cli");
        if(true == $isCli)
            {
            Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, false);
            }
        }

CLI ATTR.

+4

:

  • switch ATTR_AUTO_ACCESSOR_OVERRIDE 'mySymfonyFolder/lib/vendor/symfony/lib/plugins//sfDoctrinePlugin/config/sfDoctrineConfiguration.class.php'

, :

  • switch ATTR_AUTO_ACCESSOR_OVERRIDE off with β†’ setAttribute (Doctrine:: ATTR_AUTO_ACCESSOR_OVERRIDE, false);
  • β†’ setAttribute (Doctrine:: ATTR_AUTO_ACCESSOR_OVERRIDE, true);
+1

All Articles