<?php
/*
 * shopping/flag/Load.class.php
 * 
 * CopyRight(C) 2010 Shopformer Development Team. All Right Reserved
 * URL: http://sourceforge.jp/projects/shopformer/
 * 
 * 
 * Mail: m_nakashima@users.sourceforge.jp
 * Last Update: 2010-02-12
 * 
 */
require_once( dirname(dirname(__FILE__))
.DIRECTORY_SEPARATOR.'PackageConfig.class.php' );
class shopping_flag_Load extends system_login_ModuleBase {
	function shopping_flag_Load(){
	}
	function execute( & $request ) {
		$dbo					= $request->getAttribute( 'dbo' );
		$shoppingProductFlagNumber	= stripslashes( $_GET['shpfn'] );
		$shoppingProductFlagObject	= spider_Controller::createObject('shopping_DaoShoppingProductFlag');
		if ( strlen(trim($shoppingProductFlagNumber)) == 0 ) {
			$request->addLocaledError('shopping.error.flag.selectflag',SPIDER_LOG_LEVEL_FATAL,array(''));
		} else if( preg_match('/^[0-9]+$/',$shoppingProductFlagNumber) > 0 ){
			if ( !$dbo->loadByNumber( $shoppingProductFlagObject, $shoppingProductFlagNumber ) ) {
				$request->addLocaledError('shopping.error.flag.notfound',SPIDER_LOG_LEVEL_FATAL,array(''));
			}
		}
		$request->setAttribute('shopping.flag.flag_object',		$shoppingProductFlagObject);
	}
}
?>