source: Dev/branches/jos-branch/classes/AnswerConnector.php @ 141

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

Started work on Answer and AnswerConnector?.

note to self: (Session -> AnswerSet? (SurveyId?, Respondent, Answer*)

File size: 1.4 KB
Line 
1<?php
2// Survey database interface class as intermediate for storing data from the site to the RDF database
3require_once 'rdfConstants.php';
4// Include RAP Library to write RDF files
5include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
6
7/**
8 * Description of AnswerConnector
9 *
10 * @author jkraaijeveld
11 */
12class AnswerConnector implements IConnector{
13    protected $model;
14    protected $fileName = 'data/users/users.rdf';
15   
16    /**
17     * Constructor for AnswerConnector
18     */
19    public function __construct() {
20        //Ensure the required folder for this connector exists
21        if (!is_dir('data/answers/'))
22            mkdir('data/answers/');
23    }
24   
25    /**
26     * function load()
27     * Loads the file into the standard MemModel.
28     */
29    public function load() {
30        //Get the Memory Model from the ModelFactory
31        $this->model = ModelFactory::getDefaultModel();
32       
33        //Ensure the required file exists before loading
34        if(file_exists($this->fileName))
35            $this->model->load($this->fileName);
36    }
37   
38    /**
39     * function save()
40     * Saves the MemModel into the given file.
41     */
42    public function save() {
43        $this->model->saveAs($this->fileName,'rdf');
44    }
45   
46    public function get($arguments)
47    {
48       
49    }
50   
51    /**
52     *
53     * @param type $rToolObject
54     */
55    public function set($rToolObject)
56    {
57       
58    }
59}
60
61?>
Note: See TracBrowser for help on using the repository browser.