From ad3bbdd6bce37eb3e66fdf36c7992aace90bc6c2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 14 Aug 2018 20:31:42 +0200 Subject: [PATCH] app/models/Data/User.php: adding setOAuthId() --- app/models/Data/User.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/models/Data/User.php b/app/models/Data/User.php index 22a7df7..df02c81 100644 --- a/app/models/Data/User.php +++ b/app/models/Data/User.php @@ -295,6 +295,20 @@ class User extends Model return $this->linkedin_id; } + /** + * @param string $provider + * @param string $id + * @return $this + */ + public function setOAuthId($provider, $id) + { + $method = 'set' . ucfirst($provider) . 'Id'; + if (method_exists($this, $method)) { + $this->$method($id); + } + return $this; + } + /** * @param string $id * @return User