src/ngrest/base/Api.php
public function findModel($id)
    {
        $model = $this->findModelClassObject($this->modelClass, $id, 'view');
        
        if (!$model) {
            throw new NotFoundHttpException("Unable to find the Model for the given ID");
        }
        
        return $model;
    }
public function findModel($id)
    {
        $model = $this->findModelClassObject($this->modelClass, $id, 'view');
        
        if (!$model) {
            throw new NotFoundHttpException("Unable to find the Model for the given ID");
        }
        
        return $model;
    }
public function findModel ( $ id ) { $ model = $ this -> findModelClassObject ( $ this -> modelClass , $ id , 'view' ) ; if ( ! $ model ) { throw new NotFoundHttpException ( "Unable to find the Model for the given ID" ) ; } return $ model ; }
Get the Model for the API based on a given Id.

If not found a NotFoundHttpException will be thrown.

@params integer|string $id The id to performe the findOne() method.
@throws NotFoundHttpException
@return \luya\admin\ngrest\base\NgRestModel
Get the Model for the API based on a given Id .