Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1497
 
1675
 
1675
 
category.php
_> 11 <?php
  22 /*
<> 3 -  $Id: account.php 207 2005-09-26 01:29:31 +0200 (Mo, 26 Sep 2005) hpdl $
   3+  $Id: $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
  77 
<> 8 -  Copyright (c) 2005 osCommerce
   8+  Copyright (c) 2007 osCommerce
99 
  1010   This program is free software; you can redistribute it and/or modify
  1111   it under the terms of the GNU General Public License v2 (1991)
  1212   as published by the Free Software Foundation.
  1313 */
  1414 
<>  15+/**
   16+ * The osC_Category class manages category information
   17+ */
   18+
1519   class osC_Category {
<> 16 -    var $_data = array();
1720 
<> 18 -    function osC_Category($id) {
   21+/**
   22+ * An array containing the category information
   23+ *
   24+ * @var array
   25+ * @access private
   26+ */
   27+
   28+    private $_data = array();
   29+
   30+/**
   31+ * Constructor
   32+ *
   33+ * @param int $id The ID of the category to retrieve information from
   34+ * @access public
   35+ */
   36+
   37+    public function __construct($id) {
1938       global $osC_CategoryTree;
  2039 
<> 21 -      if ($osC_CategoryTree->exists($id)) {
   40+      if ( $osC_CategoryTree->exists($id) ) {
2241         $this->_data = $osC_CategoryTree->getData($id);
  2342       }
  2443     }
  2544 
<> 26 -    function getID() {
   45+/**
   46+ * Return the ID of the assigned category
   47+ *
   48+ * @access public
   49+ * @return integer
   50+ */
   51+
   52+    public function getID() {
2753       return $this->_data['id'];
  2854     }
  2955 
<> 30 -    function getTitle() {
   56+/**
   57+ * Return the title of the assigned category
   58+ *
   59+ * @access public
   60+ * @return string
   61+ */
   62+
   63+    public function getTitle() {
3164       return $this->_data['name'];
  3265     }
  3366 
<> 34 -    function getImage() {
   67+/**
   68+ * Return the image of the assigned category
   69+ *
   70+ * @access public
   71+ * @return string
   72+ */
   73+
   74+    public function getImage() {
3575       return $this->_data['image'];
  3676     }
  3777 
<> 38 -    function hasParent() {
  39 -      if ($this->_data['parent_id'] > 0) {
  40 -        return true;
  41 -      }
   78+/**
   79+ * Check if the assigned category has a parent category
   80+ *
   81+ * @access public
   82+ * @return boolean
   83+ */
4284 
<> 43 -      return false;
   85+    public function hasParent() {
   86+      return ( $this->_data['parent_id'] > 0 );
4487     }
  4588 
<> 46 -    function getParent() {
   89+/**
   90+ * Return the parent ID of the assigned category
   91+ *
   92+ * @access public
   93+ * @return integer
   94+ */
   95+
   96+    public function getParent() {
4797       return $this->_data['parent_id'];
  4898     }
  4999 
<> 50 -    function getPath() {
   100+/**
   101+ * Return the breadcrumb path of the assigned category
   102+ *
   103+ * @access public
   104+ * @return string
   105+ */
   106+
   107+    public function getPath() {
51108       global $osC_CategoryTree;
  52109 
  53110       return $osC_CategoryTree->buildBreadcrumb($this->_data['id']);
  54111     }
<>  112+
   113+/**
   114+ * Return specific information from the assigned category
   115+ *
   116+ * @access public
   117+ * @return mixed
   118+ */
   119+
   120+    public function getData($keyword) {
   121+      return $this->_data[$keyword];
   122+    }
<_ 55123   }
  56124 ?>