Quick Search:

View

Revision:

Diff

Diff from 1498 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/includes/classes/category.php

Annotated File View

hpdl
208
1 <?php
2 /*
3   $Id: account.php 207 2005-09-26 01:29:31 +0200 (Mo, 26 Sep 2005) hpdl $
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
8   Copyright (c) 2005 osCommerce
9
hpdl
1498
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
208
13 */
14
15   class osC_Category {
16     var $_data = array();
17
18     function osC_Category($id) {
hpdl
299
19       global $osC_CategoryTree;
hpdl
208
20
hpdl
299
21       if ($osC_CategoryTree->exists($id)) {
22         $this->_data = $osC_CategoryTree->getData($id);
hpdl
208
23       }
24     }
25
hpdl
298
26     function getID() {
27       return $this->_data['id'];
28     }
hpdl
208
29
hpdl
298
30     function getTitle() {
31       return $this->_data['name'];
hpdl
208
32     }
33
34     function getImage() {
hpdl
298
35       return $this->_data['image'];
hpdl
208
36     }
hpdl
299
37
38     function hasParent() {
39       if ($this->_data['parent_id'] > 0) {
40         return true;
41       }
42
43       return false;
44     }
45
46     function getParent() {
47       return $this->_data['parent_id'];
48     }
49
50     function getPath() {
51       global $osC_CategoryTree;
52
53       return $osC_CategoryTree->buildBreadcrumb($this->_data['id']);
54     }
hpdl
208
55   }
56 ?>