public function init() { $this->modelClass = VUserExternalInfo::className(); $this->findModel = UserController::className() . '::' . UserController::METHOD_FIND_MODEL; $this->checkAccess = UserController::className() . '::' . UserController::METHOD_CHECK_ACCESS; parent::init(); }
public static function findModelByClientIdAndAccessToken($client_id, $access_token) { self::checkAccessByClientIdAndAccessToken($client_id, $access_token); $model = VUserExternalInfo::findOne(['access_token' => $access_token, 'client_id' => $client_id]); if (isset($model)) { unset($model->user_uuid); unset($model->access_token); unset($model->client_id); unset($model->nickname); return $model; } else { throw new NotFoundHttpException("Object not found."); } }