Пример #1
0
 /**
  * Given a model ID (model identifier) this method returns the
  * full model name.
  *
  * @param string $model
  * @return string $fullname
  */
 public static function getModelName($model)
 {
     if (self::$modelFormatter) {
         return self::$modelFormatter->formatModel($model);
     } else {
         return "Model_" . ucfirst($model);
     }
 }
Пример #2
0
 /**
  * Given a model ID (model identifier) this method returns the
  * full model name.
  *
  * @param string           $model
  * @param RedBean_OODBBean $bean
  *
  * @return string
  */
 public function getModelName($model, $bean = NULL)
 {
     if (isset($this->modelCache[$model])) {
         return $this->modelCache[$model];
     }
     if (is_object($this->modelFormatter)) {
         $name = $this->modelFormatter->formatModel($model, $bean);
     } elseif (is_callable($this->modelFormatter)) {
         $name = call_user_func($this->modelFormatter, $model, $bean);
     } else {
         $prefix = defined('REDBEAN_MODEL_PREFIX') ? REDBEAN_MODEL_PREFIX : 'Model_';
         $name = $prefix . ucfirst($model);
     }
     $this->modelCache[$model] = $name;
     return $name;
 }
Пример #3
0
 /**
  * Given a model ID (model identifier) this method returns the
  * full model name.
  *
  * @param string $model
  * @param RedBean_OODBBean $bean
  * 
  * @return string $fullname
  */
 public static function getModelName($model, $bean = null)
 {
     if (self::$modelFormatter) {
         return self::$modelFormatter->formatModel($model, $bean);
     } else {
         return 'Model_' . ucfirst($model);
     }
 }
Пример #4
0
 /**
  * Given a model ID (model identifier) this method returns the
  * full model name.
  *
  * @param string           $model
  * @param RedBean_OODBBean $bean
  *
  * @return string
  */
 public static function getModelName($model, $bean = NULL)
 {
     if (self::$modelFormatter) {
         return self::$modelFormatter->formatModel($model, $bean);
     } else {
         $prefix = defined('REDBEAN_MODEL_PREFIX') ? REDBEAN_MODEL_PREFIX : 'Model_';
         return $prefix . ucfirst($model);
     }
 }
Пример #5
0
 /**
  * Given a model ID (model identifier) this method returns the
  * full model name.
  *
  * @param string $model
  * @param RedBean_OODBBean $bean
  * 
  * @return string $fullname
  */
 public static function getModelName($model, $bean = null)
 {
     if (isset(self::$modelCache[$model])) {
         return self::$modelCache[$model];
     }
     if (self::$modelFormatter) {
         $modelID = self::$modelFormatter->formatModel($model, $bean);
     } else {
         $modelID = 'Model_' . ucfirst($model);
     }
     self::$modelCache[$model] = $modelID;
     return self::$modelCache[$model];
 }