Adldap\Laravel\Traits\ImportsUsers::getModelFromAdldap PHP 메소드

getModelFromAdldap() 보호된 메소드

Returns an existing or new Eloquent user from the specified Adldap user instance.
protected getModelFromAdldap ( User $user, string | null $password = null ) : Model
$user Adldap\Models\User
$password string | null
리턴 Illuminate\Database\Eloquent\Model
    protected function getModelFromAdldap(User $user, $password = null)
    {
        $model = $this->findOrCreateModelFromAdldap($user);
        // Sync the users password (if enabled). If no password is
        // given, we'll pass in a random 16 character string.
        $model = $this->syncModelPassword($model, $password ?: str_random());
        // Synchronize other active directory attributes on the model.
        $model = $this->syncModelFromAdldap($user, $model);
        // Bind the Adldap model to the eloquent model (if enabled).
        $model = $this->getBindUserToModel() ? $this->bindAdldapToModel($user, $model) : $model;
        return $model;
    }