src/Route/AbstractModelRoute.php
public function setModel($model)
    {
        // convert the model class into an instance
        if (!is_object($model)) {
            $this->modelClass = $model;
            $model = new $model($this->modelId);
        } else {
            $this->modelId = $model->ids();
            $this->modelClass = get_class($model);
        }

        $this->model = $model;

        return $this;
    }
public function setModel($model)
    {
        // convert the model class into an instance
        if (!is_object($model)) {
            $this->modelClass = $model;
            $model = new $model($this->modelId);
        } else {
            $this->modelId = $model->ids();
            $this->modelClass = get_class($model);
        }

        $this->model = $model;

        return $this;
    }
public function setModel ( $ model ) { // convert the model class into an instance if ( ! is_object ( $ model ) ) { $ this -> modelClass = $ model ; $ model = new $ model ( $ this -> modelId ) ; } else { $ this -> modelId = $ model -> ids ( ) ; $ this -> modelClass = get_class ( $ model ) ; } $ this -> model = $ model ; return $ this ; }
Sets the model for this route.

@param \Pulsar\Model|string $model

@return $this
Sets the model for this route .