-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserAccount.h
More file actions
44 lines (30 loc) · 851 Bytes
/
UserAccount.h
File metadata and controls
44 lines (30 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef USERACCOUNT_H
#define USERACCOUNT_H
/*
* UserAccount class for Entry.h and mainApp
* in fact class with data and methods to store in Dbo
*/
#include <Wt/WDate.h>
#include <Wt/WString.h>
#include <Wt/Dbo/Dbo.h>
#include <Wt/Dbo/WtSqlTraits.h>
using namespace Wt;
class Entry;
namespace dbo = Wt::Dbo;
class userAccount
{
public:
dbo::collection< dbo::ptr<Entry> > entries;
userAccount(void);
userAccount(const WString& name);
dbo::collection<dbo::ptr<Entry>>
entriesInRange(const WDate& from, const WDate& until) const;
static dbo::ptr<userAccount> login(dbo::Session& session, const WString& user);
template<class Action>
void persist(Action& a) {
dbo::field(a, name, "name");
dbo::hasMany(a, entries, dbo::ManyToOne, "user");
}
WString name;
};
#endif // USERACCOUNT_H