/** * Define the hydration schema based on a query object. * Fills the Formatter's properties using a Criteria as source * * @param ModelCriteria $criteria * * @return PropelFormatter The current formatter object */ public function init(ModelCriteria $criteria) { $this->dbName = $criteria->getDbName(); $this->class = $criteria->getModelName(); $this->peer = $criteria->getModelPeerName(); $this->setWith($criteria->getWith()); $this->asColumns = $criteria->getAsColumns(); $this->hasLimit = $criteria->getLimit() != 0; return $this; }
public function testGetModelPeerName() { $c = new ModelCriteria('bookstore', 'Book'); $this->assertEquals('BookPeer', $c->getModelPeerName(), 'getModelPeerName() returns the name of the Peer class associated to the model class'); }