/
Startgroup.php
83 lines (72 loc) · 1.62 KB
/
Startgroup.php
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
namespace iuf\junia\model;
use iuf\junia\model\Base\Startgroup as BaseStartgroup;
use iuf\junia\serializer\StartgroupSerializer;
use keeko\framework\model\ApiModelInterface;
/**
* Skeleton subclass for representing a row from the 'kk_junia_startgroup' table.
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*/
class Startgroup extends BaseStartgroup implements ApiModelInterface {
/**
*/
private static $serializer;
/**
* @return StartgroupSerializer
*/
public static function getSerializer() {
if (self::$serializer === null) {
self::$serializer = new StartgroupSerializer();
}
return self::$serializer;
}
/**
* @return Judge
*/
public function getP1() {
return $this->getPerformanceJudge(1);
}
/**
* @return Judge
*/
public function getP2() {
return $this->getPerformanceJudge(2);
}
/**
* @return Judge
*/
public function getP3() {
return $this->getPerformanceJudge(3);
}
/**
* @return Judge
*/
public function getP4() {
return $this->getPerformanceJudge(4);
}
/**
* @return Judge
*/
public function getP5() {
return $this->getPerformanceJudge(5);
}
/**
* @param mixed $position
*/
public function getPerformanceJudge($position) {
$judges = $this->getJudges();
foreach ($judges as $judge) {
if ($judge->getPosition() == 'P' . $position) {
return $judge;
}
}
$judge = new Judge();
$judge->setPosition('P' . $position);
$judge->setStartgroup($this);
$judge->save();
return $judge;
}
}