/** * * @param string $pTableName 数据库表名 * @param int $pDBConfig 数据库连接配置文件中配置ID * @access public */ function __construct($pTableName, $pDBConfig = 0) { parent::__construct(); $this->SqlCommand =& KISS_KDO_SqlCommand::getInstance($pDBConfig); $this->mTableHash = array('name' => $pTableName); $this->prepareMapHash(); }
/** * 析构函数 * */ public function __destruct() { parent::__destruct(); if (KISS_Framework_Config::getMode() == 'debug') { KISS_Util_Debug::dumpinfo(); } }
/** * 构造函数 * * @param string $class_name 类名 */ public function __construct($class_name) { parent::__construct(); try { $context = KISS_Framework_Context::getInstance(); $context->mClassName = $class_name; $filter = KISS_Class::getClassConstant($context->mClassName, 'FILTERS'); $filters = $filter == '' ? array() : explode(',', $filter); } catch (Exception $error) { $page = new KISS_Page(); $page->showMessage($error->getMessage()); } while (count($filters) > 0) { $filter = array_shift($filters); $filter = new $filter(); $filter->doPreProcessing($context, $this); } }
/** * 构造函数 * */ function __construct() { $this->mGET = $_GET; $this->mPOST = $_POST; $type_hash['string'] = FILTER_SANITIZE_STRING; $type_hash['int'] = FILTER_VALIDATE_INT; $type_hash['email'] = FILTER_VALIDATE_EMAIL; parent::__construct(); $this->mContext = KISS_Framework_Context::getInstance(); $this->mCurrentUser =& $this->mContext->mCurrentUser; $this->mCurrentTime = time(); $class = get_class($this); if (isset(KISS_Framework_Config::$annotation['class_var'][$class]) && count(KISS_Framework_Config::$annotation['class_var'][$class]) > 0) { foreach (KISS_Framework_Config::$annotation['class_var'][$class] as $key => $value) { if (isset($value['source'])) { $source_code = "if(isset({$value['source']}))return {$value['source']};"; $source = eval($source_code); switch ($value['type']) { case 'string': $var = filter_var($source, $type_hash[$value['type']]); if (isset($value['min']) || isset($value['max'])) { $strlen = KISS_Util_String::strlen($source); } if (!is_null($var) && $var != '' && (!isset($value['min']) || $strlen >= $value['min']) && (!isset($value['max']) || $strlen <= $value['max'])) { $this->{$key} = $var; } break; case 'int': $var = filter_var($source, $type_hash[$value['type']]); if ($var !== false && (!isset($value['min']) || $var >= $value['min']) && (!isset($value['max']) || $var <= $value['max'])) { if (isset($value['class'])) { $this->{$key} = eval(sprintf('return new %s(%d);', $value['class'], $var)); } else { $this->{$key} = $var; } } elseif (isset($value['require'])) { throw new Exception($value['require']); } break; case 'email': $var = filter_var($source, $type_hash[$value['type']]); if ($var !== false) { $this->{$key} = $var; } break; case 'timestamp': $var = @strtotime($source); if ($var !== false) { $this->{$key} = $var; } break; case 'mix': $this->{$key} = $source; break; default: break; } } } } }
function __construct($pDBConfig = "") { parent::__construct(); }
function __destruct() { $this->closeDBForce(); parent::__destruct(); }