[symfony-users] Re: Fast query on all records

2009-09-14 Thread HAUSa
My thought as well, but however it should be executed! When I create a new record, the last piece of code ($this-setRank(1)) is executed, all new records have '1' as rank value. On 14 sep, 01:00, Sid Bachtiar sid.bacht...@gmail.com wrote: If it doesn't show up and there's no error, it is

[symfony-users] Re: Fast query on all records

2009-09-14 Thread Sid Bachtiar
You realized that your update code only get executed upon saving new record? It's because of: if($this-isNew()) On Mon, Sep 14, 2009 at 10:10 PM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: My thought as well, but however it should be executed! When I create a new record, the last

[symfony-users] Re: Fast query on all records

2009-09-14 Thread HAUSa
Ofcourse. As I said here above: When I create a new record, the last piece of code ($this-setRank(1)) is executed, all new records have '1' as rank value. That makes it strange that the query is not executed, at it is in the same if statement... Anyone who knows a solution for this? How is it

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Gábor Fási
http://snippets.symfony-project.org/snippet/50 On Sun, Sep 13, 2009 at 22:44, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: Is there a fast way to update all records matching a criteria? What I could do, is this: $results = MyPeer::doSelect(new Criteria()); foreach($results as

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Sid Bachtiar
This might help http://snippets.symfony-project.org/snippet/50 On Mon, Sep 14, 2009 at 8:44 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: Is there a fast way to update all records matching a criteria? What I could do, is this: $results = MyPeer::doSelect(new Criteria());

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Sid Bachtiar
Try this: $oConnection = Propel::getConnection(); $oSelectCriteria = new Criteria(); $oUpdateCriteria = new Criteria(); $oUpdateCriteria-add(EstatePeer::RANK, 'rank=rank+1', Criteria::CUSTOM_EQUAL); // rank goes 1 up BasePeer::doUpdate($oSelectCriteria, $oUpdateCriteria, $oConnection); On

[symfony-users] Re: Fast query on all records

2009-09-13 Thread HAUSa
Helas, no difference... I also tried to just state '5' instead of the 'rank=rank+1'. But then also nothing is updated. On 13 sep, 23:17, Sid Bachtiar sid.bacht...@gmail.com wrote: Try this: $oConnection = Propel::getConnection(); $oSelectCriteria = new Criteria(); $oUpdateCriteria = new

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Gábor Fási
This criteria means: all records, that have a star as their ID. Try Sid's modification, so an empty criteria, that means all records. On Sun, Sep 13, 2009 at 23:14, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: $oSelectCriteria-add(EstatePeer::ID, '*'); //all records

[symfony-users] Re: Fast query on all records

2009-09-13 Thread HAUSa
I tried that, that was my helas no difference answer. But besides that, I also tried the '5' instead of 'rank=rank+1' update, but also that didn't work. My code now: $oConnection = Propel::getConnection(); $oSelectCriteria = new Criteria(); $oUpdateCriteria = new Criteria();

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Sid Bachtiar
Did you get any error message? On Mon, Sep 14, 2009 at 9:44 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: I tried that, that was my helas no difference answer. But besides that, I also tried the '5' instead of 'rank=rank+1' update, but also that didn't work. My code now:

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Sid Bachtiar
What's the SQL query in the debug log? On Mon, Sep 14, 2009 at 10:03 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: No... On 13 sep, 23:53, Sid Bachtiar sid.bacht...@gmail.com wrote: Did you get any error message? On Mon, Sep 14, 2009 at 9:44 AM, HAUSa

[symfony-users] Re: Fast query on all records

2009-09-13 Thread HAUSa
Hmm... that query is not found in the controlpanel_dev.log... sep 14 00:13:20 symfony [info] {estateActions} Call estateActions- executeCreate() sep 14 00:13:20 symfony [debug] {sfPropelLogger} exec: SET NAMES 'utf8' sep 14 00:13:20 symfony [debug] {sfPropelLogger} prepare: INSERT INTO estate

[symfony-users] Re: Fast query on all records

2009-09-13 Thread Sid Bachtiar
If it doesn't show up and there's no error, it is possible that the piece of code isn't executed at all. On Mon, Sep 14, 2009 at 10:19 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: Hmm... that query is not found in the controlpanel_dev.log... sep 14 00:13:20 symfony [info]