controllers/FilesController.php
/**
     * Finds the Files model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Files the loaded model
     * @throws MethodNotAllowedHttpException
     */
Finds the Files model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown.
@param integer $id
@return Files the loaded model
@throws MethodNotAllowedHttpException
Finds the Files model based on its primary key value . If the model is not found a 404 HTTP exception will be thrown . @param integer $id @return Files the loaded model @throws MethodNotAllowedHttpException
protected function findModel($id)
    {
        if (($model = Files::findOne($id)) !== null) {
            if (Yii::$app->user->id == $model->user_id) {
                return $model;
            }
        }
        throw new MethodNotAllowedHttpException('Not allowed action');
    }
protected function findModel ( $ id ) { if ( ( $ model = Files :: findOne ( $ id ) ) !== null ) { if ( Yii :: $ app -> user -> id == $ model -> user_id ) { return $ model ; } } throw new MethodNotAllowedHttpException ( 'Not allowed action' ) ; }
Finds the Files model based on its primary key value.
Finds the Files model based on its primary key value .