Location: PHPKode > projects > Entier Studio > entierstudio/studio/classes/procs/interchange/proc.ElementPackageAssociationWriter.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.ElementPackageAssociationWriter.php 115 2008-03-07 22:29:12Z yannromefort $
 */
//-----------------------------------------------------------------------------
//	namespace
if (!defined("DefElementPackageAssociationWriter")) {
    //-------------------------------------------------------------------------
    //	Define
    define("DefElementPackageAssociationWriter", "1");
    //-------------------------------------------------------------------------
    //	Include
    @require_once (INTERCHANGE_PROC. "proc.ElementAssociationWriter.php");
    //-------------------------------------------------------------------------
    //	Class
    class ElementPackageAssociationWriter extends ElementAssociationWriter {
        //---------------------------------------------------------------------
        //	Constructor
        
        /**
         *
         */
        function ElementPackageAssociationWriter() {
            //            
        }
        //---------------------------------------------------------------------
        //	Methods
        
        /**
         *
         * @access	protected
         *
         * @param	object		name="datasource"
         * @param	object		name="template"
         * @param	integer		name="handle"
         * @param	string		name="block"
         * @param	integer		element pkid
         *
         * @return	boolean
         *
         */
        function addAssociatedClass(&$datasource, &$template, $handle, $block, $primarykey) {
            //
            $reference = new InterchangeElementReference($primarykey);
            if ($reference->selectRow($datasource, FOREIGNKEY) == true) {
                //
                $element = new ObjectoryElement($reference->get_field_value("OBJELEMRFID"));
                if ($element->selectRow($datasource) == true) {
                    //
                    $template->select($block, $handle);
                    $template->assign($element->fieldSet() , NULL, $handle);
                    $template->render($block, $handle);
                    //
                    return (true);
                }
            }
            //
            return (true);
        }
    };
    //	Class
    //-------------------------------------------------------------------------    
}
//	namespace
//-----------------------------------------------------------------------------
?>
Return current item: Entier Studio