Categories
symfony

Propel Criteria Builder

Those for somones who really dont like to write criteria code (it’s me ;-))

http://propel.jondh.me.uk/criteria/analyse

This is utility that converts SQL into PHP Propel code. I found it really usefull.

P.S. Thanks to Alex Filatov for this link.

15 replies on “Propel Criteria Builder”

Glad you like it, and thanks for posting it. My next step on this is to convert it to a symfony plugin, and then add some of the improvements at the bottom of the page. Should you want to get involved in the development of this, feel free to join in the discussion on the related thread in the fora!

Thank you for your kind comments. On a related note, I’d urge all readers – especially new users of Propel – to use some sort of code completion where they can. I am using Eclipse PDT, and it really has simplified the writing of Criteria code; with the right settings, pretty much everything can be made “look ahead”.

Yes, actually the link in article is exactly converter for mysql to propel criteria code or I did not understand the question

I give like this, customer.id,customer.name,customer.accono where customer.id=’$id’ but i got the result as
$c = new Criteria();
$crit0 = $c->getNewCriterion(CustomerPeer::NAME, ‘$name’);

What is wrong with me??

Well, sorry but actually I’m not developer of that convertor service. Not sure why you are asking about this here ๐Ÿ™‚

hey guys, help me, how to convert this to propel:

select a.id, b.title, b.start_time, b.end_time from tv_channel a
left join tv_program b on a.id = b.tv_channel_id and b.start_time >= ‘2011-09-23 12:00:00’ and b.end_time <= '2011-09-23 14:30:00'
order by a.code
limit 0, 10;

–pager object
tnx

Leave a Reply

Your email address will not be published. Required fields are marked *