ADmad\HybridAuth\Auth\HybridAuthAuthenticate::_profileEntity PHP Method

_profileEntity() protected method

Get social profile entity
protected _profileEntity ( Cake\ORM\Entity $profile = null ) : Cake\ORM\Entity
$profile Cake\ORM\Entity Social profile entity
return Cake\ORM\Entity
    protected function _profileEntity($profile = null)
    {
        if (!$profile) {
            $profile = $this->_profileModel->newEntity(['provider' => $this->adapter()->id]);
        }
        foreach (get_object_vars($this->profile()) as $key => $value) {
            switch ($key) {
                case 'webSiteURL':
                    $profile->set('website_url', $value);
                    break;
                case 'profileURL':
                    $profile->set('profile_url', $value);
                    break;
                case 'photoURL':
                    $profile->set('photo_url', $value);
                    break;
                default:
                    $profile->set(Inflector::underscore($key), $value);
                    break;
            }
        }
        return $profile;
    }