b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Source for file _genericcategory.class.php

Documentation is available at _genericcategory.class.php

  1. <?php
  2. /**
  3.  * This file implements the GenericCategory class.
  4.  *
  5.  * This file is part of the evoCore framework - {@link http://evocore.net/}
  6.  * See also {@link http://sourceforge.net/projects/evocms/}.
  7.  *
  8.  * @copyright (c)2003-2010 by Francois PLANQUE - {@link http://fplanque.net/}
  9.  *  Parts of this file are copyright (c)2005-2006 by PROGIDISTRI - {@link http://progidistri.com/}.
  10.  *
  11.  *  {@internal License choice
  12.  *  - If you have received this file as part of a package, please find the license.txt file in
  13.  *    the same folder or the closest folder above for complete license terms.
  14.  *  - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15.  *    then you must choose one of the following licenses before using the file:
  16.  *    - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17.  *    - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18.  *  }}}
  19.  *
  20.  *  {@internal Open Source relicensing agreement:
  21.  *  PROGIDISTRI S.A.S. grants Francois PLANQUE the right to license
  22.  *  PROGIDISTRI S.A.S.'s contributions to this file and the b2evolution project
  23.  *  under any OSI approved OSS license (http://www.opensource.org/licenses/).
  24.  *  }}}
  25.  *
  26.  * @package evocore
  27.  *
  28.  * @author fplanque: Francois PLANQUE.
  29.  * @author mbruneau: Marc BRUNEAU / PROGIDISTRI
  30.  *
  31.  * @version $Id: _genericcategory.class.php,v 1.8 2010/02/08 17:53:03 efy-yury Exp $
  32.  */
  33. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  34.  
  35.  
  36. load_class('generic/model/_genericelement.class.php''GenericElement');
  37.  
  38.  
  39. /**
  40.  * GenericCategory Class
  41.  *
  42.  * @package evocore
  43.  */
  44. {
  45.     var $parent_ID;
  46.     /**
  47.      * To display parent name in form
  48.      */
  49.     var $parent_name;
  50.  
  51.     /**
  52.      * Category children list
  53.      */
  54.     var $children = array();
  55.  
  56.     /**
  57.      * Constructor
  58.      *
  59.      * @param string Table name
  60.      * @param string 
  61.      * @param string DB ID name
  62.      * @param array|NULLDatabase row
  63.      */
  64.     function GenericCategory$tablename$prefix ''$dbIDname 'ID'$db_row NULL )
  65.     {
  66.         global $Debuglog;
  67.  
  68.         // Call parent constructor:
  69.         parent::GenericElement$tablename$prefix$dbIDname$db_row );
  70.  
  71.         if$db_row != NULL )
  72.         {
  73.             $parentIDfield $prefix.'parent_ID';
  74.             $this->parent_ID = $db_row->$parentIDfield;
  75.         }
  76.     }
  77.  
  78.  
  79.     /**
  80.      * Load data from Request form fields.
  81.      *
  82.      * @todo fp> check that we are not creating a loop!
  83.      *
  84.      * @return boolean true if loaded data seems valid.
  85.      */
  86.     function load_from_request()
  87.     {
  88.         parent::load_from_Request();
  89.  
  90.         ifparam$this->dbprefix.'parent_ID''integer'-!== -)
  91.         {
  92.             $this->set_from_Request'parent_ID' );
  93.         }
  94.  
  95.         return param_errors_detected();
  96.     }
  97.  
  98.  
  99.     /**
  100.      * Set param value
  101.      *
  102.      * By default, all values will be considered strings
  103.      *
  104.      * @param string parameter name
  105.      * @param mixed parameter value
  106.      * @param boolean true to set to NULL if empty value
  107.      * @return boolean true, if a value has been set; false if it has not changed
  108.      */
  109.     function set$parname$parvalue$make_null false )
  110.     {
  111.         switch$parname )
  112.         {
  113.              case 'parent_ID':
  114.                 return $this->set_param$parname'string'$parvaluetrue );
  115.  
  116.             case 'name':
  117.             case 'urlname':
  118.             case 'description':
  119.             default:
  120.                 return $this->set_param$parname'string'$parvalue$make_null );
  121.         }
  122.     }
  123.  
  124.  
  125.     /**
  126.      * Add a child
  127.      * @todo dh> "children" is plural..!
  128.      * @param GenericCategory 
  129.      */
  130.     function add_children$GenericCategory )
  131.     {
  132.         $this->children[$GenericCategory;
  133.     }
  134.  
  135. }
  136.  
  137.  
  138. /*
  139.  * $Log: _genericcategory.class.php,v $
  140.  * Revision 1.8  2010/02/08 17:53:03  efy-yury
  141.  * copyright 2009 -> 2010
  142.  *
  143.  * Revision 1.7  2009/09/14 18:37:07  fplanque
  144.  * doc/cleanup/minor
  145.  *
  146.  * Revision 1.6  2009/09/14 12:25:47  efy-arrin
  147.  * Included the ClassName in load_class() call with proper UpperCase
  148.  *
  149.  * Revision 1.5  2009/09/13 22:12:55  blueyed
  150.  * Fix saving of urlname/description for tags (LP: #428201)
  151.  *
  152.  * Revision 1.4  2009/08/30 17:27:03  fplanque
  153.  * better NULL param handling all over the app
  154.  *
  155.  * Revision 1.3  2009/03/08 23:57:43  fplanque
  156.  * 2009
  157.  *
  158.  * Revision 1.2  2008/01/21 09:35:30  fplanque
  159.  * (c) 2008
  160.  *
  161.  * Revision 1.1  2007/06/25 11:00:15  fplanque
  162.  * MODULES (refactored MVC)
  163.  *
  164.  * Revision 1.14  2007/04/26 00:11:11  fplanque
  165.  * (c) 2007
  166.  *
  167.  * Revision 1.13  2006/12/09 17:59:33  fplanque
  168.  * started "moving chapters accross blogs" feature
  169.  *
  170.  * Revision 1.12  2006/11/24 18:27:24  blueyed
  171.  * Fixed link to b2evo CVS browsing interface in file docblocks
  172.  *
  173.  * Revision 1.11  2006/11/22 20:45:36  blueyed
  174.  * doc/todo
  175.  
  176.  */
  177. ?>

Documentation generated on Sat, 06 Mar 2010 04:11:36 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).