source: Dev/trunk/classes/Application.php @ 186

Last change on this file since 186 was 186, checked in by jkraaijeveld, 13 years ago

Implemented lazy evaluation.

  • Initially, references to other database objects are now given as an ID rather than an object.
  • Every model class now has an evaluate() function, which gets all the objects that object has references to. Returns true if it got all the values correctly, false if there are invalid references.
  • Every connector now first evaluates an object before storing, to make sure only objects with valid references get stored.
File size: 893 bytes
RevLine 
[56]1<?php
2
3/**
4 * Description of Application
5 *
[158]6 * @author jkraaijeveld
[56]7 */
[131]8class Application extends ResearchToolObject{
[78]9   
[75]10    public $title;
11    public $description;
12    public $style;
[56]13
[158]14        /**
15         * Constructor for an Application object
16         * @param type $uid : The uid of the Application object.
17         * @param type $title: The title of the Application.
18         * @param type $description: The description of the Application.
19         * @param type $style: The style of the Application.
20         */
[131]21    public function __construct($uid = null, $title = null, $description = null, $style = null)
[78]22    {
[131]23        if(!isset ($uid))
24        {
25            $uid = md5(uniqid(rand(), true));
26        }
27        $this->uid = $uid;
[75]28        $this->title = $title;
[78]29        $this->description = $description;
[186]30                $this->style = $style;
31        }
32       
33        public function evaluate()
34        {
35                //Do nothing, there are no references in application.
36        }
[56]37
38}
39?>
Note: See TracBrowser for help on using the repository browser.