Last change
on this file since 95 was
69,
checked in by fpvanagthoven, 14 years ago
|
You can now delete anywhere from pipeline.
|
File size:
1.4 KB
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Description of Session |
---|
5 | * |
---|
6 | * @author fpvanagthoven |
---|
7 | */ |
---|
8 | class Session { |
---|
9 | |
---|
10 | public $title; |
---|
11 | public $description; |
---|
12 | public $pipeline; |
---|
13 | public $count; |
---|
14 | |
---|
15 | public function __construct($title, $description) { |
---|
16 | $this->title = $title; |
---|
17 | $this->description = $description; |
---|
18 | $this->count = 0; |
---|
19 | |
---|
20 | $this->pipeline = array(); |
---|
21 | } |
---|
22 | |
---|
23 | public static function getSession($info) |
---|
24 | { |
---|
25 | if (!empty($info)) |
---|
26 | { |
---|
27 | $title = $info['sessionTitle']; |
---|
28 | $description = $info['sessionDescription']; |
---|
29 | $session = new Session($title, $description); |
---|
30 | $session->count = $info['pipelineCount']; |
---|
31 | |
---|
32 | $pipelineCount = 1; |
---|
33 | for ($i = 1; $i < $session->count + 1; $i++) |
---|
34 | { |
---|
35 | if (isset($info[$i . 's'])) |
---|
36 | { |
---|
37 | $session->pipeline[$i . 's'] = $info[$i . 's']; |
---|
38 | } |
---|
39 | else if (isset($info[$i . 'd'])) |
---|
40 | { |
---|
41 | $session->pipeline[$i . 'd'] = $info[$i . 'd']; |
---|
42 | } |
---|
43 | else if (isset($info[$i . 'a'])) |
---|
44 | { |
---|
45 | $session->pipeline[$i . 'a'] = $info[$i . 'a']; |
---|
46 | } |
---|
47 | |
---|
48 | $pipelineCount++; |
---|
49 | } |
---|
50 | |
---|
51 | return $session; |
---|
52 | } |
---|
53 | else |
---|
54 | return null; |
---|
55 | } |
---|
56 | |
---|
57 | } |
---|
58 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.