Esempio n. 1
0
 /**
  * Tests Jelly::register()
  * 
  * @dataProvider provider_register
  */
 public function test_register($model, $expected)
 {
     $this->assertSame(Jelly::register($model), $expected);
 }
Esempio n. 2
0
 /**
  * Gets a particular set of metadata about a model. If the model
  * isn't registered, it will attempt to register it.
  *
  * FALSE is returned on failure.
  *
  * @param   string|Jelly_Model  $model
  * @return  Jelly_Meta
  */
 public static function meta($model)
 {
     $model = Jelly::model_name($model);
     if (!isset(Jelly::$_models[$model])) {
         if (!Jelly::register($model)) {
             return FALSE;
         }
     }
     return Jelly::$_models[$model];
 }