/
iconDao.ts
63 lines (56 loc) · 1.61 KB
/
iconDao.ts
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { MediaDao } from '../../related/media/mediaDao';
import { IconRow } from './iconRow';
import { IconTable } from './iconTable';
import { UserCustomDao } from '../../../user/custom/userCustomDao';
import { UserCustomResultSet } from '../../../user/custom/userCustomResultSet';
import { UserCustomRow } from '../../../user/custom/userCustomRow';
import { StyleMappingRow } from './styleMappingRow';
/**
* Icon DAO for reading user icon data tables
*/
export class IconDao extends MediaDao {
constructor(dao: UserCustomDao) {
super(dao, new IconTable(dao.getTable()));
}
/**
* @inheritDoc
*/
public getTable(): IconTable {
return super.getTable() as IconTable;
}
/**
* @inheritDoc
*/
public newRow(): IconRow {
return new IconRow(this.getTable());
}
/**
* Get the icon row from the current result set location
* @param resultSet result set
* @return icon row
*/
public getRowWithResultSet(resultSet: UserCustomResultSet): IconRow {
return this.getRow(resultSet.getRow());
}
/**
* Get a icon row from the user custom row
* @param row custom row
* @return icon row
*/
public getRow(row: UserCustomRow): IconRow {
return new IconRow(row);
}
/**
* Query for the icon row from a style mapping row
* @param styleMappingRow style mapping row
* @return icon row
*/
public queryForRow(styleMappingRow: StyleMappingRow): IconRow {
let iconRow = null;
const userCustomRow = this.queryForIdRow(styleMappingRow.getRelatedId());
if (userCustomRow != null) {
iconRow = this.getRow(userCustomRow);
}
return iconRow;
}
}