Esempio n. 1
0
 function testGetResModelForBaseModel()
 {
     $baseModel = ModelFactory::getDefaultModel();
     $resModel = ModelFactory::getResModelForBaseModel($baseModel);
     $this->assertIsEmptyResModel($resModel, 'ResModel');
     $this->addAStatement($baseModel);
     $this->assertIdentical(1, $resModel->size());
 }
Esempio n. 2
0
 /** 
  * Returns a ResModel.
  * $modelType has to be one of the following constants:
  * MEMMODEL,DBMODEL,INFMODELF,INFMODELB to create a resmodel with a new
  * model from defined type.
  * You can supply a base URI
  *
  * @param   constant  $modelType
  * @param   string  $baseURI
  * @return	object	ResModel
  * @access	public
  */
 function &getResModel($modelType, $baseURI = null)
 {
     switch ($modelType) {
         case DBMODEL:
             $baseModel = ModelFactory::getDefaultDbModel($baseURI);
             break;
         case INFMODELF:
             $baseModel = ModelFactory::getInfModelF($baseURI);
             break;
         case INFMODELB:
             $baseModel = ModelFactory::getInfModelB($baseURI);
             break;
         default:
             $baseModel = ModelFactory::getMemModel($baseURI);
             break;
     }
     return ModelFactory::getResModelForBaseModel($baseModel);
 }
Esempio n. 3
0
 /**
  * Returns a ResModel with this model as baseModel. This is the same as
  * ModelFactory::getResModelForBaseModel($this).
  *
  * @return	object	ResModel
  * @access	public
  */
 function &getResModel()
 {
     return ModelFactory::getResModelForBaseModel($this);
 }