Services_Yahoo_JP
[ class tree: Services_Yahoo_JP ] [ index: Services_Yahoo_JP ] [ all elements ]

Source for file Auction.php

Documentation is available at Auction.php

  1. <?php
  2. /**
  3.  * Auction dispatcher
  4.  *
  5.  * PHP version 5
  6.  *
  7.  * LICENSE: This source file is subject to the New BSD license that is
  8.  * available through the world-wide-web at the following URI:
  9.  * http://www.opensource.org/licenses/bsd-license.php. If you did not receive
  10.  * a copy of the New BSD License and are unable to obtain it through the web,
  11.  * please send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @category  Services
  14.  * @package   Services_Yahoo_JP
  15.  * @author    Tetsuya Nakase <phpizer@gmail.com>
  16.  * @copyright 2008 Tetsuya Nakase
  17.  * @license   http://www.opensource.org/licenses/bsd-license.php BSD
  18.  * @version   CVS: $Id: Auction.php,v 1.1 2008/04/28 15:59:31 tetsuya Exp $
  19.  * @link      http://phpize.net
  20.  */
  21.  
  22. require_once "Services/Yahoo/Exception.php";
  23.  
  24. /**
  25.  * Auction dispatcher class
  26.  *
  27.  * This class provides a method to create a concrete instance of one
  28.  * of the supported Auction types (category, exhibit, goods).
  29.  *
  30.  * @category  Services
  31.  * @package   Services_Yahoo_JP
  32.  * @author    Tetsuya Nakase <phpizer@gmail.com>
  33.  * @copyright 2008 Tetsuya Nakase
  34.  * @license   http://www.opensource.org/licenses/bsd-license.php BSD
  35.  * @version   Release: 0.0.1
  36.  * @link      http://phpize.net
  37.  */
  38. {
  39.     /**
  40.      * Attempts to return a concrete instance of a auction class
  41.      *
  42.      * @param string $type Can be one of category, goods or exhibit
  43.      *
  44.      * @return object  Concrete instance of a auction class based on the paramter
  45.      * @throws Services_Yahoo_Exception
  46.      */
  47.     public function factory($type)
  48.     {
  49.         switch ($type{
  50.         case 'category':
  51.         case 'goods'   :
  52.         case 'exhibit' :
  53.             include_once 'Services/Yahoo/JP/Auction/' $type '.php';
  54.             $classname 'Services_Yahoo_JP_Auction_' ucfirst($type);
  55.             return new $classname;
  56.         default :
  57.             throw new Services_Yahoo_Exception('Unknown Auction type ' $type);
  58.             break;
  59.         }
  60.     }
  61. }
  62. ?>

Documentation generated on Fri, 19 Sep 2008 21:30:05 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.