Commit b6457aa7ee4933ad8c4e554659ffe53b6d2fca9d

Authored by nbm
1 parent 471d47a8

Remove unused TimePeriod and TimeUnit


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5252 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/archiving/TimePeriod.inc deleted
1   -<?php
2   -/**
3   - * $Id$
4   - *
5   - * Represents a time period.
6   - *
7   - * Copyright (c) 2006 Jam Warehouse http://www.jamwarehouse.com
8   - *
9   - * This program is free software; you can redistribute it and/or modify
10   - * it under the terms of the GNU General Public License as published by
11   - * the Free Software Foundation; using version 2 of the License.
12   - *
13   - *
14   - * This program is distributed in the hope that it will be useful,
15   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   - * GNU General Public License for more details.
18   - *
19   - * You should have received a copy of the GNU General Public License
20   - * along with this program; if not, write to the Free Software
21   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22   - *
23   - * @version $Revision$
24   - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
25   - * @package lib.archiving
26   - */
27   -
28   -class TimePeriod extends KTEntity {
29   - /**
30   - * The primary key
31   - */
32   - var $iId;
33   - /**
34   - * The time units
35   - */
36   - var $iTimeUnitID;
37   - /**
38   - * The number of units
39   - */
40   - var $iUnits;
41   -
42   - /**
43   - * Constructs an time period instance
44   - *
45   - * @param date the time unit
46   - * @param integer the expiration time period id
47   - */
48   - function TimePeriod($iNewTimeUnitID, $iNewUnits) {
49   - global $default;
50   -
51   - // primary key not set as this is not stored yet
52   - $this->iId = -1;
53   - $this->iTimeUnitID = $iNewTimeUnitID;
54   - $this->iUnits = $iNewUnits;
55   - }
56   -
57   - /**
58   - * Gets the primary key
59   - */
60   - function getID(){
61   - return $this->iId;
62   - }
63   -
64   - /**
65   - * Gets the time unit
66   - */
67   - function getTimeUnitID() {
68   - return $this->iTimeUnitID;
69   - }
70   -
71   - /**
72   - * Sets the time unit
73   - *
74   - * @param integer the new time unit
75   - */
76   - function setTimeUnitID($iNewTimeUnitID){
77   - $this->iTimeUnitID = $iNewTimeUnitID;
78   - }
79   -
80   - /**
81   - * Gets the units
82   - */
83   - function getUnits(){
84   - return $this->iUnits;
85   - }
86   -
87   - /**
88   - * Sets the units
89   - *
90   - * @param integer the new units
91   - */
92   - function setUnits($iNewUnits){
93   - $this->iUnits = $iNewUnits;
94   - }
95   -
96   - function _fieldValues () {
97   - return array(
98   - 'time_unit_id' => $this->iTimeUnitID,
99   - 'units' => $this->iUnits
100   - );
101   - }
102   -
103   - function _table () {
104   - global $default;
105   - return $default->time_period_table;
106   - }
107   -
108   - /**
109   - * Static function. Given a primary key will create
110   - * a TimePeriod object and populate it with the corresponding
111   - * database values
112   - *
113   - * @return TimePeriod populated TimePeriod object on success, false otherwise
114   - */
115   - function & get($iTimePeriodID) {
116   - global $default;
117   - $sql = $default->db;
118   - $sql->query(array("SELECT * FROM $default->time_period_table WHERE id = ?", $iTimePeriodID));/*ok*/
119   - if ($sql->next_record()) {
120   - $oTimePeriod = & new TimePeriod($sql->f("time_unit_id"), $sql->f("units"));
121   - $oTimePeriod->iId = $iTimePeriodID;
122   - return $oTimePeriod;
123   - }
124   - return false;
125   - }
126   -
127   - /**
128   - * Static function
129   - * Get a list of TimePeriod objects
130   - *
131   - * @param String Where clause (optional)
132   - * @return Array array of TimePeriod objects, false otherwise
133   - */
134   - function getList($sWhereClause = null) {
135   - return KTEntityUtil::getList(TimePeriod::_table(), 'TimePeriod', $sWhereClause);
136   - }
137   -}
lib/archiving/TimeUnit.inc deleted
1   -<?php
2   -/**
3   - * $Id$
4   - *
5   - * Represents time units.
6   - *
7   - * Copyright (c) 2006 Jam Warehouse http://www.jamwarehouse.com
8   - *
9   - * This program is free software; you can redistribute it and/or modify
10   - * it under the terms of the GNU General Public License as published by
11   - * the Free Software Foundation; using version 2 of the License.
12   - *
13   - *
14   - * This program is distributed in the hope that it will be useful,
15   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   - * GNU General Public License for more details.
18   - *
19   - * You should have received a copy of the GNU General Public License
20   - * along with this program; if not, write to the Free Software
21   - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22   - *
23   - * @version $Revision$
24   - * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
25   - * @package lib.archiving
26   - */
27   -
28   -class TimeUnit extends KTEntity {
29   - /**
30   - * The primary key
31   - */
32   - var $iId;
33   - /**
34   - * The time unit
35   - */
36   - var $sName;
37   -
38   - /**
39   - * Constructs an time unit instance
40   - *
41   - * @param string the time unit name
42   - */
43   - function TimeUnit($sNewName) {
44   - global $default;
45   -
46   - // primary key not set as this is not stored yet
47   - $this->iId = -1;
48   - $this->sName = $sNewName;
49   - }
50   -
51   - /**
52   - * Gets the primary key
53   - */
54   - function getID(){
55   - return $this->iId;
56   - }
57   -
58   - /**
59   - * Gets the name
60   - */
61   - function getName() {
62   - return $this->sName;
63   - }
64   -
65   - /**
66   - * Sets the name
67   - *
68   - * @param string the new name
69   - */
70   - function setName($sNewName){
71   - $this->sName = $sNewName;
72   - }
73   -
74   - function _fieldValues () {
75   - return array(
76   - 'name' => $this->sName,
77   - );
78   - }
79   -
80   - function _table () {
81   - global $default;
82   - $sTable = $default->time_unit_lookup_table;
83   - }
84   -
85   - /**
86   - * Static function. Given a news item primary key will create
87   - * a TimeUnit object and populate it with the corresponding
88   - * database values
89   - *
90   - * @return TimeUnit populated TimeUnit object on success, false otherwise
91   - */
92   - function & get($iTimeUnitID) {
93   - global $default;
94   - $sql = $default->db;
95   - $sql->query(array("SELECT * FROM $default->time_unit_lookup_table WHERE id = ?", $iTimeUnitID));/*ok*/
96   - if ($sql->next_record()) {
97   - $oTimeUnit = & new TimeUnit($sql->f("name"));
98   - $oTimeUnit->iId = $iTimeUnitID;
99   - return $oTimeUnit;
100   - }
101   - return false;
102   - }
103   -
104   - /**
105   - * Static function
106   - * Get a list of TimeUnit objects
107   - *
108   - * @param String Where clause (optional)
109   - * @return Array array of TimeUnit objects, false otherwise
110   - */
111   - function getList($sWhereClause = null) {
112   - return KTEntityUtil::getList(TimeUnit::_table(), 'TimeUnit', $sWhereClause);
113   - }
114   -}