Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel] AS column behavior change

propel
Discussion topic

Back to topic list

Re: [propel] AS column behavior change

Reply

Author hlellelid
Full name Hans Lellelid
Date 2008-06-16 07:22:05 PDT
Message Err ... I made some typos in there. That should have been
addSelectColumns()

On Mon, 16 Jun 2008 08:15:46 -0400, Hans Lellelid <hans at velum dot net> wrote:
> I should have pointed this out earlier. The AS columns behavior has
> changed in the 1.3 RC1 to correct for what I feel was a bug in previous
> versions. This does, however, require a slight change to your code if
you
> are using Criteria->addAsColumn() with queries that hydrate Propel
> objects.
>
> This is also reflected now in the upgrade guide:
>
> With ticket 634 (http://propel.phpdb.​org/trac/ticket/634)​, the behavior
> for
> As columns (added via Criteria->addAsColumn()) has changed slightly. "As"
> columns are now considered a valid select clause, and the generated Peer
> classes will not automatically add the Peer columns if there are already
> As
> clause elements present. While this allows you to use Criteria for
queries
> that do not populate objects, it also requires that you add the select
> columns yourself if you do want to populate objects. Use the
> GeneratedPeer::attSe​lectColumns(Criteria​) method to add the select
> columns.
>
> For example:
>
> $c = new Criteria(MyPeer::DAT​ABASE_NAME);
> MyPeer::addSelectColumn($c);
> $c->addAsColumn('colname', 'expr');
>
> Let me know if you have any questions about this.
>
> Hans
>
>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: users-unsubscribe@pr​opel.tigris.org
> For additional commands, e-mail: users-help at propel dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

Re: [propel] AS column behavior change hlellelid Hans Lellelid 2008-06-16 07:22:05 PDT
Messages per page: