示例#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->setClass($criteria->getModelName());
     $this->setWith($criteria->getWith());
     $this->asColumns = $criteria->getAsColumns();
     $this->hasLimit = $criteria->getLimit() != 0;
     return $this;
 }
示例#2
0
 public function testGetModelName()
 {
     $c = new ModelCriteria('bookstore', 'Propel\\Tests\\Bookstore\\Book');
     $this->assertEquals('Propel\\Tests\\Bookstore\\Book', $c->getModelName(), 'getModelName() returns the name of the class associated to the model class');
 }