Passed
Push — master ( 22b733...fe8595 )
by Mathieu
02:34
created

Classroom.getShooting   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
1
import {
2
  Entity,
3
  Column,
4
  PrimaryGeneratedColumn,
5
  ManyToOne
6
} from 'typeorm';
7
import { Shooting } from './Shooting.entity';
8
9
@Entity()
10
export class Classroom {
11
  @PrimaryGeneratedColumn('uuid')
12
  private id: string;
13
14
  @Column({ type: 'varchar', nullable: false })
15
  private name: string;
16
17
  @ManyToOne(() => Shooting, { nullable: false, onDelete: 'CASCADE' })
18
  private shooting: Shooting;
19
20
  constructor(name: string, shooting: Shooting) {
21
    this.name = name;
22
    this.shooting = shooting;
23
  }
24
25
  public getId(): string {
26
    return this.id;
27
  }
28
29
  public getName(): string {
30
    return this.name;
31
  }
32
33
  public getShooting(): Shooting {
34
    return this.shooting;
35
  }
36
}
37