Of course the one problem with that is that you may not be using
standard SQL in the query as a result and therefore one of the key
benefits of DAL (Database Abstraction Layer) no longer exists; the
ability to switch DB's with little to no problem.

Any reason you couldn't do the comparison's after getting a resultset?
I have myself found that PHP can do things like IF comparisons and the
like faster than SQL can run it in the query.

Glad you got it working though.

On Mon, Jul 19, 2010 at 11:39 AM, HAUSa
<[email protected]> wrote:
> Thanks, this answer gave me a start where to look.
>
> You still can hydrate, if you do it like this:
>
> ProductPeer::addSelectColumns($oCriteria);
> $oCriteria->addAsColumn('current_price', 'IF(MAX(' . BidPeer::BID . ')
>> ' . ProductPeer::PRICE . ', MAX(' . BidPeer::BID . '), ' .
> ProductPeer::PRICE . ')');
>
> Then all the "normal" table columns are added, after that the custom
> column is.
>
>
> On 19 jul, 00:17, xplo <[email protected]> wrote:
>> Hello,
>>
>> you probably can call raw sql on select clause with addAsColumn on
>> your criteria but it wont be hydrated in your result objects so you
>> should try propel 1.5 with the new "with" method that add custom
>> select statement and hydrate them in the object.
>>
>> On Jul 18, 7:58 pm, HAUSa <[email protected]>
>> wrote:
>>
>> > If everything goes well, a SQL file is created in your /data/sql
>> > folder.
>> > I don't know why that does not happen, it should :)
>> > Otherwise try build-all. Beware, this creates the model files as well
>> > and replaces the database.
>>
>> > Please back to topic! Feel free to open a new discussion for this one.
>>
>> > I'm eager to use the IF() SQL statement, but I can't find anything
>> > about it in the Propel documentation.
>> > Anyone who knows how that is possible?
>>
>> > On 18 jul, 19:36, Richard Zulu <[email protected]> wrote:
>>
>> > > Hi,
>>
>> > > I installed symfony 1.4.6. However, whenever i run the propel:build-sql
>> > > command it doesn't generate my schema.sql file in the data directory. Am
>> > > using Ubuntu and have phing active too. It gives me this output:
>>
>> > > php symfony propel:build-sql
>>
>> > > >> schema    converting "/home/zulu/sfprojects/config/schema.yml" to XML
>> > > >> schema    putting /home/zulu/sfprojects/config/generated-schema.xml
>> > > >> propel    Running "sql" phing task
>> > > >> file-     /home/zulu/sfprojects/config/generated-schema.xml
>> > > >> file-     
>> > > >> /home/zulu/sfprojects/config/generated-schema-transformed.xml
>>
>> > > then after this i cannot find my schema.sql file
>>
>> > > Anyone know why
>>
>> > > --
>> > > Richard Zulu
>> > > Managing Director
>> > > Time Information Company
>> > > P.O Box 31842
>> > > Clock Tower
>> > > Kampala, Ugandawww.time.co.ug
>>
>>
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to