Zikula_Core
[ class tree: Zikula_Core ] [ index: Zikula_Core ] [ all elements ]

Source for file PNCategoryRegistry.class.php

Documentation is available at PNCategoryRegistry.class.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright value4business GmbH
  6.  * @link http://www.zikula.org
  7.  * @version $Id: PNCategoryRegistry.class.php 20307 2006-10-14 21:06:59Z rgasch $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @author Robert Gasch rgasch@gmail.com
  10.  * @package Zikula_Core
  11.  */
  12.  
  13.  
  14. /**
  15.  * PNCategoryRegistry
  16.  *
  17.  * @package Zikula_System_Modules
  18.  * @subpackage Categories
  19.  */
  20. class PNCategoryRegistry extends PNObject
  21. {
  22.     function PNCategoryRegistry($init=null$key=0)
  23.     {
  24.         // ensure the language file is available
  25.         pnModLangLoad('Categories''admin');
  26.  
  27.         $this->PNObject();
  28.         $this->_objType 'categories_registry';
  29.         $this->_objPath 'category_registry';
  30.  
  31.         $this->_objValidation['modname']     array ('modname'true'noop'''_CATEGORIES_REGISTRY_MODULE_EMPTY);
  32.         $this->_objValidation['table']       array ('table'true'noop'''_CATEGORIES_REGISTRY_TABLE_EMPTY);
  33.         $this->_objValidation['property']    array ('property'true'noop'''_CATEGORIES_REGISTRY_PROPERTY_EMPTY);
  34.         $this->_objValidation['category_id'array ('category_id'true'noop'''_CATEGORIES_REGISTRY_CATEGORY_EMPTY);
  35.  
  36.         $this->_init($init$key);
  37.     }
  38.  
  39.  
  40.     function deletePostProcess ($data=null)
  41.     {
  42.         // After delete, it should delete the references to this registry
  43.         // in the categories mapobj table
  44.         $where "WHERE cmo_reg_id = '{$this->_objData[$this->_objField]}'";
  45.         DBUtil::deleteWhere('categories_mapobj'$where);
  46.     }
  47.  
  48.  
  49.     function validatePostProcess ($data=null)
  50.     {
  51.         $data $this->_objData;
  52.         if ($data['modname'&& $data['table'&& $data['property'&& !$data['id']{
  53.         $where "WHERE crg_modname='$data[modname]' AND crg_table='$data[table]' AND crg_property='$data[property]'";
  54.         $row DBUtil::selectObject ($this->_objType$where);
  55.         if ($row{
  56.                 $_SESSION['validationErrors'][$this->_objPath]['property'_CATEGORIES_REGISTRY_PROPERTY_DUPLICATE;
  57.             $_SESSION['validationFailedObjects'][$this->_objPath$this->_objData;
  58.             return false;
  59.         }
  60.     }
  61.  
  62.     return true;
  63.     }
  64. }

Documentation generated on Fri, 18 Jul 2008 21:52:49 +0200 by phpDocumentor 1.4.1