source: trunk/grails-app/domain/dbnp/studycapturing/EventGroup.groovy @ 857

Last change on this file since 857 was 857, checked in by duh, 12 years ago
  • added Assay Page
  • Property svn:keywords set to Author Rev Date
File size: 627 bytes
Line 
1package dbnp.studycapturing
2
3/**
4 * EventGroup groups events
5 *
6 * Revision information:
7 * $Rev: 857 $
8 * $Author: duh $
9 * $Date: 2010-08-30 10:12:21 +0000 (ma, 30 aug 2010) $
10 */
11class EventGroup extends Identity {
12        String name
13
14        static belongsTo = [parent : Study]
15        static hasMany = [
16                subjects: Subject,
17                events: Event,
18                samplingEvents: SamplingEvent
19        ]
20
21        static constraints = {
22                // Ensure that the event group name is unique within the study
23                name(unique:['parent']) 
24        }
25
26        /**
27         * Return all events and samplingEvents
28         * @return ArrayList
29         */
30        def ArrayList getAllEvents() {
31                return (
32                        ((events) ? events : [])
33                        +
34                        ((samplingEvents) ? samplingEvents : [])
35                )
36        }
37}
Note: See TracBrowser for help on using the repository browser.