Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 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');
 }