Changeset 171 for Dev/trunk/classes/ApplicationConnector.php
- Timestamp:
- 12/02/11 15:26:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/ApplicationConnector.php
r158 r171 11 11 * @author jkraaijeveld 12 12 */ 13 class ApplicationConnector implements IConnector{13 class ApplicationConnector extends Connector{ 14 14 15 protected $model;16 protected $fileName = 'data/applications/applications.rdf';17 18 15 /** 19 16 * Constructor for ApplicationConnector. … … 21 18 public function __construct() 22 19 { 20 $this->fileName = 'data/applications/applications.rdf'; 23 21 //Ensure the required folder for this connector exists 24 22 if (!is_dir('data/applications/')) 25 23 mkdir('data/applications/'); 26 }27 28 /**29 * function load()30 * Loads the file into the standard MemModel.31 */32 public function load() {33 //Get the Memory Model from the ModelFactory34 $this->model = ModelFactory::getDefaultModel();35 36 //Ensure the required file exists before loading37 if(file_exists($this->fileName))38 $this->model->load($this->fileName);39 }40 41 /**42 * function save()43 * Saves the MemModel into the given file.44 */45 public function save() {46 $this->model->saveAs($this->fileName,'rdf');47 24 } 48 25 … … 54 31 public function get($arguments) { 55 32 $this->load(); 56 //Determine which arguments are supplied57 $keys = array_keys($arguments);58 //Set default values for arguments59 $uid = ""; $title = ""; $description = ""; $style = "";60 //Set the arguments if they are supplied61 if(in_array("uid", $keys))62 $uid = "predicates:uid \"".$arguments["uid"]."\"";63 if(in_array("title", $keys))64 $title = 'predicates:title \''.$arguments["title"].'\'';65 if(in_array("description", $keys))66 $description = "predicates:description \"".$arguments["description"]."\"";67 if(in_array("style", $keys))68 $style = "predicates:style \"".$arguments["style"]."\"";69 33 70 34 //Create the querystring … … 80 44 predicates:description ?description ; 81 45 predicates:style ?style ; ' 82 . $ uid . $title . $description . $style. '46 . $this->createArguments($arguments) . ' 83 47 }'; 84 48
Note: See TracChangeset
for help on using the changeset viewer.