This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Multiple Propel 1.5 aggregate_column behaviors in schema.yml - is it possible?
Multiple Propel 1.5 aggregate_column behaviors in schema.yml - is it possible? [message #102572] Fri, 16 July 2010 10:52 Go to previous message
zsoltk  is currently offline zsoltk
Messages: 5
Registered: July 2010
Location: Budapest
Junior Member
Hello,

I'm using Symfony 1.4 + Propel 1.5. I'd like to set multiple aggregate columns on a table.

As in the documentation of Propel 1.5:
http://www.propelorm.org/wiki/Documentation/1.5/Behaviors/ag gregate_column , one can do it only by adding the aggregate_column behavior multiple times.

However (as I dislike writing schema in xml) when my schema.yml gets converted to xml (and then the sql is generated based on it), I end up having only one aggregate_column behavior on the table. I guess it's because they have the same name and the last one overwrites all the previous.

So:

  product:
    _propel_behaviors:
      aggregate_column: { name: nb_images, foreign_table: product_image, expression: "COUNT(id)" }
      aggregate_column: { name: nb_testimonials, foreign_table: product_testimonial, expression: "COUNT(id)" }


ends up

  <table name="product">
    <behavior name="aggregate_column">
      <parameter name="name" value="nb_testimonials" />
      <parameter name="foreign_table" value="product_testimonial" />
      <parameter name="expression" value="COUNT(id)" />
    </behavior>


and the nb_images is lost.

I googled a lot, couldn't even find anyone having this problem. Does anyone have any idea how to solve it?

Thanks a lot in advance.

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:admin generator language
Next Topic:Use View Filters in Model
Goto Forum:

  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software