Exemplo n.º 1
0
 public function getDefinition($modelName = null, $reset = false)
 {
     // we want to use a static variable here for performance
     // reasons, but we also need a way to reliably cope when
     // (not if) the master list of definitions is emptied
     static $oDef = null;
     // special case
     if ($reset) {
         $oDef = null;
         return;
     }
     if ($modelName == null) {
         $modelName = get_class($this);
     }
     if ($oDef === null) {
         $oDef = DataModel_Definitions::get($modelName);
         DataModel_Definitions::registerCache($this, $modelName);
     }
     return $oDef;
 }