コード例 #1
0
 public function onRollback(ConnectionEvent $event)
 {
     $this->models = array();
     //there sould be error in commit so clear cached models
     $models = $this->processedModels;
     $this->processedModels = array();
     $this->applyTransactionState(false, $models, $event->getConnection());
 }
コード例 #2
0
 public function testEvents()
 {
     $con = \Propel::getConnection();
     $e = new ConnectionEvent($con);
     $this->assertSame($con, $e->getConnection());
     $e = new PeerEvent($cls = 'SomeClass');
     $this->assertEquals($cls, $e->getClass());
     $e = new QueryEvent($q = new BookQuery());
     $this->assertSame($q, $e->getQuery());
 }