CakeDC\Users\Model\Behavior\SocialBehavior::_createSocialUser PHP Метод

_createSocialUser() защищенный Метод

Creates social user, populate the user data based on the social login data first and save it
protected _createSocialUser ( array $data, array $options = [] ) : boolean | Cake\Datasource\EntityInterface | mixed
$data array Array social user.
$options array Array option data.
Результат boolean | Cake\Datasource\EntityInterface | mixed result of the save operation
    protected function _createSocialUser($data, $options = [])
    {
        $useEmail = Hash::get($options, 'use_email');
        $validateEmail = Hash::get($options, 'validate_email');
        $tokenExpiration = Hash::get($options, 'token_expiration');
        $existingUser = null;
        $email = Hash::get($data, 'email');
        if ($useEmail && empty($email)) {
            throw new MissingEmailException(__d('CakeDC/Users', 'Email not present'));
        } else {
            $existingUser = $this->_table->find()->where([$this->_table->alias() . '.email' => $email])->first();
        }
        $user = $this->_populateUser($data, $existingUser, $useEmail, $validateEmail, $tokenExpiration);
        $this->_table->isValidateEmail = $validateEmail;
        $result = $this->_table->save($user);
        return $result;
    }