source: Dev/trunk/classes_old/Session.php @ 228

Last change on this file since 228 was 137, checked in by jkraaijeveld, 14 years ago

Added old classes

File size: 1.4 KB
RevLine 
[137]1<?php
2
3/**
4 * Description of Session
5 *
6 * @author fpvanagthoven
7 */
8class 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.