model() публичный Метод

Create a new Model object
public model ( string $viewName, array $config = [] ) : Model
$viewName string The name of the view we're getting a Model for.
$config array Optional MVC configuration values for the Model object.
Результат FOF30\Model\Model
Пример #1
0
 /**
  * Create a new Model object
  *
  * @param   string  $viewName  The name of the view we're getting a Model for.
  * @param   array   $config    Optional MVC configuration values for the Model object.
  *
  * @return  Model
  */
 public function model($viewName, array $config = array())
 {
     try {
         return parent::model($viewName, $config);
     } catch (ModelNotFound $e) {
         $magic = new Magic\ModelFactory($this->container);
         return $magic->make($viewName, $config);
     }
 }
Пример #2
0
 /**
  * Create a new Model object
  *
  * @param   string  $viewName  The name of the view we're getting a Model for.
  * @param   array   $config    Optional MVC configuration values for the Model object.
  *
  * @return  Model
  */
 public function model($viewName, array $config = array())
 {
     try {
         return parent::model($viewName, $config);
     } catch (ModelNotFound $e) {
     }
     $modelClass = $this->container->getNamespacePrefix('inverse') . 'Model\\' . ucfirst($viewName);
     try {
         return $this->createModel($modelClass, $config);
     } catch (ModelNotFound $e) {
         $modelClass = $this->container->getNamespacePrefix('inverse') . 'Model\\' . ucfirst($this->container->inflector->singularize($viewName));
         return $this->createModel($modelClass, $config);
     }
 }