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.
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”
You’re welcome 🙂
BTW, I like to write Criteria code 🙂
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!
Oh it’s great honor! author of this great tool itself commented my post. Thanks a lot and I’ll keep an eye on its progress for sure.
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”.
Hi, Is there any converter for mysql to propel criteria code???
Yes, actually the link in article is exactly converter for mysql to propel criteria code or I did not understand the question
how can i got the id,name from my table according to my id??
ClassPeer::retrieveByPK($id)
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 🙂
The linked page is not working any more.
It has the symfony Oops page LOL!
go here http://propel.jondh.me.uk/criteria/analyse
btw, how to convert this to propel:
SELECT teachersfname as tfn, teacherslname as tln FROM `teachers` UNION SELECT fname as tfn, lname as tln FROM `students` ORDER BY tfn
sorry, it’s http://propel.jondh.me.uk/
Thanks, It helped me on a tough query
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