source: Dev/trunk/classes/Session.php @ 105

Last change on this file since 105 was 69, checked in by fpvanagthoven, 14 years ago

You can now delete anywhere from pipeline.

File size: 1.4 KB
RevLine 
[56]1<?php
2
3/**
4 * Description of Session
5 *
6 * @author fpvanagthoven
7 */
8class Session {
9
[69]10    public $title;
11    public $description;
12    public $pipeline;
13    public $count;
[56]14
[69]15    public function __construct($title, $description) {
16        $this->title = $title;
17        $this->description = $description;
18        $this->count = 0;
[56]19       
[69]20        $this->pipeline = array();
[56]21    }
[69]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                }
[56]47
[69]48                $pipelineCount++;
49            }
50           
51            return $session;
52        }
53        else
54            return null;
55    }
56
[56]57}
58?>
Note: See TracBrowser for help on using the repository browser.