Location: PHPKode > projects > Entier Studio > entierstudio/studio/classes/datas/data.DictionaryPropertyValueRuleType.php
<?php
/**
 * Entier Studio
 *
 * LICENSE
 *
 *	Copyright 2006 Entier Studio team.
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 *
 * @package    entier.studio
 * @copyright  Copyright (c) 2006 Entier Studio team. All rights reserved.
 * @version	   $Id: data.DictionaryPropertyValueRuleType.php 81 2008-01-17 23:08:21Z yannromefort $
 */
//-----------------------------------------------------------------------------
//	namespace
if (!defined("DefDictionaryPropertyValueRuleType")) {
    //-------------------------------------------------------------------------
    //	Define
    define("DefDictionaryPropertyValueRuleType", "1");
    //-------------------------------------------------------------------------
    //	Include
    @require_once (FRAMEWORK_DIR . DATAROWOBJECT);
    //-------------------------------------------------------------------------
    //	Class
    class DictionaryPropertyValueRuleType extends DataRow {
        //---------------------------------------------------------------------
        //	Constructor
        
        /**
         *
         * @param	integer	 pkid	DictionaryPropertyValue		DICPVALPKID
         * @param	integer	 fkid	DictionaryPropertyRumeType	DICPRUTPKID
         */
        function DictionaryPropertyValueRuleType($DICPVALPKID = 0, $DICPRUTPKID = 0) {
            //
            $this->m_fieldSet["DICPVALPKID"] = $DICPVALPKID;
            $this->m_fieldSet["DICPRUTPKID"] = $DICPRUTPKID;
        }
        //-------------------------------------------------------------------------
        //	Methods
        
        /**
         *
         * @param	integer	 index type
         * @return	string
         */
        function getSelectQuery($indexType = PRIMARYKEY) {
            //
            switch ($indexType) {
                case PRIMARYKEY:
                    /*
                    * SELECT
                    *			tbl_dictionary_property_value
                    *		<-> tbl_dictionary_property
                    *		<-> tbl_dictionary_property_rule_typ
                    * ON
                    *		DICPRUTPKID & DICPVALPKID
                    */
                    //
                    $index1 = $this->m_fieldSet["DICPRUTPKID"];
                    $index2 = $this->m_fieldSet["DICPVALPKID"];
                    if (($index1 != 0) && ($index2 != 0)) return ("SELECT 
									t1.DICPVALPKID, 
									t1.DICPVALNAME, 
									t1.DICPVALCODE, 
									t2.DICPROPNAME, 
									t2.DICPTYPPKID, 
									t3.DICPRUTPKID, 
									t3.DICPRUTNAME, 
									t3.DICPTYPRKID 
								FROM 
									tbl_dictionary_property_value as t1, 
									tbl_dictionary_property as t2, 
									tbl_dictionary_property_rule_type as t3 
								WHERE 
									t1.DICPVALPKID=$index2 
								AND 
									t1.DICPVALSTAT>0 
								AND 
									t1.DICPROPPKID=t2.DICPROPPKID 
								AND 
									t2.DICPROPSTAT>0 
								AND 
									t2.DICPTYPPKID =t3.DICPTYPLKID 
								AND 
									t3.DICPRUTPKID=$index1");
                    //
                    break;
                }
                //
                return ("");
        }
    };
    //	Class
    //-------------------------------------------------------------------------
    
}
//	namespace
//-----------------------------------------------------------------------------
?>
Return current item: Entier Studio