set()
set() is a fluid Interface to BasePeer::doUpdate()
sfPropelFinder::from('Article')
->whereVersion(1)
->andTitle('foo')
->orTitle('bar')
->set( array( 'Title'=>'updated title', 'Version'=>2 ) );
The API is quiet simple :
- Use fluid Interface to find objects to update
- Call set() with an associative array where the keys are the field
names to change and the values the new values to set.
I used the syntax set() as function name cause it remeber me the SQL
syntax : UPDATE table SET x=a, y=b, z=c WHERE ...
One big limitation to set() : Propel doesn't sound to support
multitable table update syntax !!'''
So
sfPropelFinder::from('Foo')->joinBar()->set($associative_array);
Will thow the following Exception :
throw new Exception('{sfPropelFinder::set()} Propel does not support multitable updates, please do not use join');
Attched to this ticket : diff files for sfPropelFinder.php and sfPropelFinderTest.php (3 new tests)
Regards,
Julien