Files can now have mirrors. Implemented SMOMatcher service to attempt to automaticall...
[rock.divinelegy.git] / config / DataMaps.php
1 <?php
2
3 //rely on the convention that any reference column is named [parent_table]_id
4 //or the other way around, the column is labled [child_table]_id
5
6 // so either we will be looking for the id of the parent table, or we will
7 // be given the id for the child table
8
9 return [
10 'Simfile' => [
11 'class' => 'Domain\Entities\StepMania\Simfile',
12 'table' => 'simfiles',
13 'maps' => [
14 //entity => table
15 'title' => DataAccess\Varchar('title'),
16 'artist' => DataAccess\VO('Artist'),
17 'uploader' => DataAccess\Entity('User', 'getUploader'),
18 'bpm' => DataAccess\VO('BPM'),
19 'bpmChanges' => DataAccess\Int('bpm_changes', 'hasBPMChanges'),
20 'stops' => DataAccess\Int('stops', 'hasStops'),
21 'fgChanges' => DataAccess\Int('fg_changes', 'hasFgChanges'),
22 'bgChanges' => DataAccess\Int('bg_changes', 'hasBgChanges'),
23 'banner' => DataAccess\Entity('File', 'getBanner', 'banner_file'),
24 'simfile' => DataAccess\Entity('File', 'getSimfile', 'simfile_file'),
25 'packId' => DataAccess\Int('pack_id', 'getPackId'),
26 'steps' => DataAccess\VOArray('StepChart', 'getSteps')
27 ]
28 ],
29
30 'Pack' => [
31 'class' => 'Domain\Entities\StepMania\Pack',
32 'table' => 'packs',
33 'maps' => [
34 'title' => DataAccess\Varchar('title'),
35 'uploader' => DataAccess\Entity('User', 'getUploader'),
36 'simfiles' => DataAccess\EntityArray('Simfile', 'getSimfiles'),
37 'banner' => DataAccess\Entity('File', 'getBanner', 'banner_file'),
38 'file' => DataAccess\Entity('File', 'getFile')
39 ]
40 ],
41
42 'BPM' => [
43 'class' => 'Domain\VOs\StepMania\BPM',
44 'table' => 'simfiles',
45 'maps' => [
46 'high' => DataAccess\Int('bpm_high', 'getHigh'),
47 'low' => DataAccess\Int('bpm_low', 'getLow')
48 ]
49 ],
50
51 'User' => [
52 'class' => 'Domain\Entities\User',
53 'table' => 'users',
54 'maps' => [
55 'country' => DataAccess\VO('Country'),
56 'displayName' => DataAccess\Varchar('display_name'),
57 'name' => DataAccess\VO('Name'),
58 'tags' => DataAccess\VOArray('Tag', 'getTags'), // TODO: Make VarcharArray class
59 'facebookId' => DataAccess\Varchar('facebook_id')
60 ]
61 ],
62
63 'Name' => [
64 'class' => 'Domain\VOs\Name',
65 'table' => 'users_meta',
66 'maps' => [
67 'firstname' => DataAccess\Varchar('firstname'),
68 'lastname' => DataAccess\Varchar('lastname')
69 ]
70 ],
71
72 'Country' => [
73 'class' => 'Domain\VOs\Country',
74 'table' => 'users_meta',
75 'maps' => [
76 'country' => DataAccess\Varchar('country', 'getCountryName')
77 ]
78 ],
79
80 'Tag' => [
81 'class' => 'Domain\VOs\StepMania\Tag',
82 'table' => 'step_artists',
83 'maps' => [
84 'tag' => DataAccess\Varchar('tag')
85 ]
86 ],
87
88 'Artist' => [
89 'class' => 'Domain\VOs\StepMania\Artist',
90 'table' => 'artists',
91 'maps' => [
92 'name' => DataAccess\Varchar('name')
93 ]
94 ],
95
96 'StepChart' => [
97 'class' => 'Domain\VOs\StepMania\StepChart',
98 'table' => 'steps',
99 'maps' => [
100 'mode' => DataAccess\VO('DanceMode', 'getMode'),
101 'difficulty' => DataAccess\VO('Difficulty'),
102 'artist' => DataAccess\VO('StepArtist', 'getArtist', 'step_artist'),
103 'rating' => DataAccess\Int('rating')
104 ]
105 ],
106
107 'DanceMode' => [
108 'class' => 'Domain\VOs\StepMania\DanceMode',
109 'table' => 'steps',
110 'maps' => [
111 'stepManiaName' => DataAccess\Varchar('mode', 'getStepManiaName')
112 ]
113 ],
114
115 'StepArtist' => [
116 'class' => 'Domain\VOs\StepMania\StepArtist',
117 'table' => 'step_artists',
118 'maps' => [
119 'tag' => DataAccess\Varchar('tag')
120 ]
121 ],
122
123 'Difficulty' => [
124 'class' => 'Domain\VOs\StepMania\Difficulty',
125 'table' => 'steps',
126 'maps' => [
127 'stepManiaName' => DataAccess\Varchar('difficulty', 'getStepManiaName')
128 ]
129 ],
130
131 'File' => [
132 'class' => 'Domain\Entities\File',
133 'table' => 'files',
134 'maps' => [
135 'hash' => DataAccess\Varchar('hash'),
136 'path' => DataAccess\Varchar('path'),
137 'filename' => DataAccess\Varchar('filename'),
138 'mimetype' => DataAccess\Varchar('mimetype'),
139 'size' => DataAccess\Int('size'),
140 'uploadDate' => DataAccess\Int('uploaded', 'getUploadDate'),
141 'mirrors' => DataAccess\VOArray('FileMirror', 'getMirrors')
142 ]
143 ],
144
145 'FileMirror' => [
146 'class' => 'Domain\VOs\FileMirror',
147 'table' => 'mirrors',
148 'maps' => [
149 'uri' => DataAccess\Varchar('uri')
150 ]
151 ]
152 ];