private function buildUser($row)
    {
        $createdOn = new \DateTimeImmutable($row['created_on']);
        $updatedOn = new \DateTimeImmutable($row['updated_on']);
        $lastLogin = null === $row['last_login']
            ? null
            : new \DateTimeImmutable($row['last_login']);

        $confirmationToken = null;
        if (null !== $row['confirmation_token_token']) {
            $confirmationToken = new UserToken($row['confirmation_token_token']);
            $this->set($confirmationToken, 'createdOn', new \DateTimeImmutable($row['confirmation_token_created_on']));
        }
        $invitationToken = null;
        if (null !== $row['invitation_token_token']) {
            $invitationToken = new UserToken($row['invitation_token_token']);
            $this->set($invitationToken, 'createdOn', new \DateTimeImmutable($row['invitation_token_created_on']));
        }
        $rememberPasswordToken = null;
        if (null !== $row['remember_password_token_token']) {
            $rememberPasswordToken = new UserToken($row['remember_password_token_token']);
            $this->set($rememberPasswordToken, 'createdOn', new \DateTimeImmutable($row['remember_password_token_created_on']));
        }

        $user = User::signUp(
            new UserId($row['id']),
            new UserEmail($row['email']),
            UserPassword::fromEncoded($row['password'], $row['salt']),
            $this->rolesToArray($row['roles'])
        );

        $user = $this->set($user, 'createdOn', $createdOn);
        $user = $this->set($user, 'updatedOn', $updatedOn);
        $user = $this->set($user, 'lastLogin', $lastLogin);
        $user = $this->set($user, 'confirmationToken', $confirmationToken);
        $user = $this->set($user, 'invitationToken', $invitationToken);
        $user = $this->set($user, 'rememberPasswordToken', $rememberPasswordToken);

        return $user;
    }
private function buildUser($row)
    {
        $createdOn = new \DateTimeImmutable($row['created_on']);
        $updatedOn = new \DateTimeImmutable($row['updated_on']);
        $lastLogin = null === $row['last_login']
            ? null
            : new \DateTimeImmutable($row['last_login']);

        $confirmationToken = null;
        if (null !== $row['confirmation_token_token']) {
            $confirmationToken = new UserToken($row['confirmation_token_token']);
            $this->set($confirmationToken, 'createdOn', new \DateTimeImmutable($row['confirmation_token_created_on']));
        }
        $invitationToken = null;
        if (null !== $row['invitation_token_token']) {
            $invitationToken = new UserToken($row['invitation_token_token']);
            $this->set($invitationToken, 'createdOn', new \DateTimeImmutable($row['invitation_token_created_on']));
        }
        $rememberPasswordToken = null;
        if (null !== $row['remember_password_token_token']) {
            $rememberPasswordToken = new UserToken($row['remember_password_token_token']);
            $this->set($rememberPasswordToken, 'createdOn', new \DateTimeImmutable($row['remember_password_token_created_on']));
        }

        $user = User::signUp(
            new UserId($row['id']),
            new UserEmail($row['email']),
            UserPassword::fromEncoded($row['password'], $row['salt']),
            $this->rolesToArray($row['roles'])
        );

        $user = $this->set($user, 'createdOn', $createdOn);
        $user = $this->set($user, 'updatedOn', $updatedOn);
        $user = $this->set($user, 'lastLogin', $lastLogin);
        $user = $this->set($user, 'confirmationToken', $confirmationToken);
        $user = $this->set($user, 'invitationToken', $invitationToken);
        $user = $this->set($user, 'rememberPasswordToken', $rememberPasswordToken);

        return $user;
    }
private function buildUser ( $ row ) { $ createdOn = new \ DateTimeImmutable ( $ row [ 'created_on' ] ) ; $ updatedOn = new \ DateTimeImmutable ( $ row [ 'updated_on' ] ) ; $ lastLogin = null === $ row [ 'last_login' ] ? null : new \ DateTimeImmutable ( $ row [ 'last_login' ] ) ; $ confirmationToken = null ; if ( null !== $ row [ 'confirmation_token_token' ] ) { $ confirmationToken = new UserToken ( $ row [ 'confirmation_token_token' ] ) ; $ this -> set ( $ confirmationToken , 'createdOn' , new \ DateTimeImmutable ( $ row [ 'confirmation_token_created_on' ] ) ) ; } $ invitationToken = null ; if ( null !== $ row [ 'invitation_token_token' ] ) { $ invitationToken = new UserToken ( $ row [ 'invitation_token_token' ] ) ; $ this -> set ( $ invitationToken , 'createdOn' , new \ DateTimeImmutable ( $ row [ 'invitation_token_created_on' ] ) ) ; } $ rememberPasswordToken = null ; if ( null !== $ row [ 'remember_password_token_token' ] ) { $ rememberPasswordToken = new UserToken ( $ row [ 'remember_password_token_token' ] ) ; $ this -> set ( $ rememberPasswordToken , 'createdOn' , new \ DateTimeImmutable ( $ row [ 'remember_password_token_created_on' ] ) ) ; } $ user = User :: signUp ( new UserId ( $ row [ 'id' ] ) , new UserEmail ( $ row [ 'email' ] ) , UserPassword :: fromEncoded ( $ row [ 'password' ] , $ row [ 'salt' ] ) , $ this -> rolesToArray ( $ row [ 'roles' ] ) ) ; $ user = $ this -> set ( $ user , 'createdOn' , $ createdOn ) ; $ user = $ this -> set ( $ user , 'updatedOn' , $ updatedOn ) ; $ user = $ this -> set ( $ user , 'lastLogin' , $ lastLogin ) ; $ user = $ this -> set ( $ user , 'confirmationToken' , $ confirmationToken ) ; $ user = $ this -> set ( $ user , 'invitationToken' , $ invitationToken ) ; $ user = $ this -> set ( $ user , 'rememberPasswordToken' , $ rememberPasswordToken ) ; return $ user ; }
Builds the user with the given sql row attributes.

@param array $row Array which contains attributes of user

@return User
Builds the user with the given sql row attributes .