public function onQueryConstruct(QueryEvent $event) { $q = $event->getQuery(); if ($q instanceof ContainerAwareInterface) { $q->setContainer($this->container); } }
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()); }