Location: PHPKode > projects > Entier Studio > entierstudio/studio/classes/procs/interchange/proc.ElementPackageClassWriter.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: proc.ElementPackageClassWriter.php 115 2008-03-07 22:29:12Z yannromefort $
 */
//-----------------------------------------------------------------------------
//	namespace
if (!defined("DefElementPackageClassWriter")) {
    //-------------------------------------------------------------------------
    //	Define
    define("DefElementPackageClassWriter", "1");
    //-------------------------------------------------------------------------
    //	Include
    @require_once (INTERCHANGE_PROC. "proc.ElementClassWriter.php");
    @include_once (INTERCHANGE_DATA. "data.InterchangeElementReferenceSet.php");
    //-------------------------------------------------------------------------
    //	Class
    class ElementPackageClassWriter extends ElementClassWriter {
        //---------------------------------------------------------------------
        //	Constructor        
        /**
         *
         */
        function ElementPackageClassWriter() {
            //            
        }
        //---------------------------------------------------------------------
        //	Methods        
        /**
         * This function overloads the initial addClassReferenceSet function
         *
         * @access	protected
         * @param	object		name="datasource"
         * @param	object		name="template"
         * @param	integer		name="handle"
         * @param	integer		name="primarykey"
         * @return	boolean
         */
        function addClassReferenceSet(&$datasource, &$template, $handle, $primarykey) {
            //	1- Reference set
            $referenceSet = new InterchangeElementReferenceSet($primarykey);
            if ($referenceSet->selectSet($datasource) == true) {
                //
                $block = array(
                    "class-references", // block 0                    
                );
                //
                for ($i = 0;$i < $referenceSet->rowCount();$i++) {
                    //	select next row
                    if (false == $referenceSet->fetchCursorRow($datasource))
                        return (false);
                    //
                    $template->select($block[0], $handle);
                    $template->assign($referenceSet->fieldSet() , NULL, $handle);
                    $template->render($block[0], $handle);
                }
            }
            //
            return (true);
        }
    };
    //	Class
    //-------------------------------------------------------------------------    
}
//	namespace
//-----------------------------------------------------------------------------
?>
Return current item: Entier Studio