/**
  * Make a new DatabaseProfile as copy of $profile
  * 
  * @param ProfileGetInterface $profile
  * @return bool
  */
 protected function copyProfileToDatabase($user, ProfileGetInterface $profile)
 {
     $database_profile = $this->socialProfileRepository->create();
     $database_profile->copy($profile);
     $database_profile->setProvider('UserProfile');
     $database_profile->setUser($user->getAuthIdentifier());
     $database_profile->setIdentifier($profile->getIdentifier());
     return $this->socialProfileRepository->saveProfile($database_profile);
 }
 protected function makeDBProfile()
 {
     $db_profile = null;
     if ($this->user !== null) {
         $db_profile = $this->profileRepository->findByUserAndProvider($this->user, $this->providerName);
     }
     return $db_profile;
 }
 public function getProfile()
 {
     $profile = null;
     $user = \Auth::user();
     if ($user !== false) {
         $profile = $this->profileRepository->findByUserAndProvider($user, 'UserProfile');
     }
     return $profile;
 }