4 * Copyright Medical Information Integration,LLC info@mi-squared.com
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * @file AbstractClickmapModel.php
12 * @brief This file contains the AbstractClickmapModel class, used to model form contents.
16 /* for $GLOBALS['srcdir','pid'] */
17 /* remember that include paths are calculated relative to the including script, not this file. */
18 require_once('../../globals.php');
20 /* for OrDataObject, the class we're extending. */
21 require_once ($GLOBALS['srcdir'] . '/classes/ORDataObject.class.php');
24 * @class AbstractClickmapModel
26 * @brief code This class extends the OrDataObject class, which is used to model form data for a smarty generated form.
28 * This class extends the ORDataObject class, to model the contents of an image-based form.
31 abstract class AbstractClickmapModel
extends ORDataObject
{
34 * The row to persist information to/from.
41 * FIXME: either last modification date OR creation date?
48 * The unique identifier of the patient this form belongs to.
55 * required field in database table. not used, always defaulted to NULL.
62 * required field in database table. not used, always defaulted to NULL.
69 * required field in the database table. always defaulted to NULL.
76 * required field in the database table. always defaulted to NULL.
83 * The contents of our form, in one field.
90 * @brief Initialize a newly created object belonging to this class
93 * The sql table to persist form contents from/to.
96 * The index of a row in the given table to initialize form contents from.
98 public function AbstractClickmapModel($table, $id="") {
99 /* Only accept numeric IDs as arguments. */
100 if (is_numeric($id)) {
106 $this->date
= date("Y-m-d H:i:s");
107 $this->_table
= $table;
109 $this->pid
= $GLOBALS['pid'];
116 * @brief Override this abstract function with your implementation of getTitle.
118 * @return The title of this form.
120 abstract function getTitle();
123 * @brief Override this abstract function with your implementation of getCode.
125 * @return A string thats a 'code' for this form.
127 abstract function getCode();
130 * @brief Fill in this object's members with the contents from the database representing the stored form.
132 function populate() {
133 /* Run our parent's implementation. */
138 * @brief Store the current structure members representing the form into the database.
141 /* Run our parent's implementation. */
145 /* The rest of this object consists of set_ and get_ pairs, for setting and getting the value of variables that are members of this object. */
151 function set_id($id) {
152 if (!empty($id) && is_numeric($id)) {
157 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
165 function set_pid($pid) {
166 if (!empty($pid) && is_numeric($pid)) {
171 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
175 function get_activity() {
176 return $this->activity
;
179 function set_activity($tf) {
180 if (!empty($tf) && is_numeric($tf)) {
181 $this->activity
= $tf;
185 trigger_error('API violation: set function called with empty or non numeric string.', E_USER_WARNING
);
192 function get_date() {
199 function set_date($dt) {
205 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
209 function get_user() {
213 function set_user($u) {
219 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);
223 function get_data() {
227 function set_data($data) {
233 trigger_error('API violation: set function called with empty string.', E_USER_WARNING
);