Location: PHPKode > scripts > ebay mine > project_lib/ebay_item.php
<?php 
class ebay_item {
	private $itemID;
	private $URL;
	private $title;
	private $subtitle;
	private $itemSold;
	private $topRatedSeller;
	private $numberOfBids;
	private $bidPrice;
	private $binPrice;
	private $boPrice;
	private $currencyType;
	private $imageURL;
	private $freeShipping;
	private $endTime;
	
	public function __construct() {
	}
	
	public function setURL( $URL ) {
		$this->URL = $URL;
	}
	
	public function setTitle( $title ) {
		$this->title = $title;
	}
	
	public function setItemID( $id ) {
		$this->itemID = $id;
	}
	
	public function setItemSold( $itemSold ) {
		$this->itemSold = $itemSold;
	}
	
	public function setTopRatedSeller( $topRatedSeller ) {
		$this->topRatedSeller = $topRatedSeller;
	}
	
	public function setImageURL( $imageURL ) {
		$this->imageURL = $imageURL;
	}
	
	public function setFreeShipping( $freeShipping ) {
		$this->freeShipping = $freeShipping;
	}
	
	public function setSubtitle( $subtitle ) {
		$this->subtitle = $subtitle;
	}
	
	public function setEndTime( $endTime ) {
		$this->endTime = $endTime;
	}
	
	public function parseAndSetPrices( $auctionTypes, $prices) {
		$number_of_prices = sizeof( $auctionTypes );
		
		for ( $i = 0; $i < $number_of_prices; $i++ ) {
			//TODO: Add hooks for foreign currency
			if ( preg_match( "/[$]([\d.]*)/", $prices[$i], $price_no_currency_match ) ) {
				$this->currencyType = "USD";
				$priceNoCurrencySymbol = $price_no_currency_match[1];
			} 
			
			if ( preg_match( "/(\d)*\s*bid/i", $auctionTypes[$i], $bids ) ) {
				$this->numberOfBids = $bids[1];
				$this->bidPrice = $priceNoCurrencySymbol;
			} else {
				$this->numberOfBids = "NULL";
				$this->bidPrice = "NULL";
			}
			
			if ( preg_match( "/now/i", $auctionTypes[$i] ) ) {
				$this->binPrice = $priceNoCurrencySymbol;
			} else {
				$this->binPrice = "NULL";
			}
			
			if ( preg_match( "/best/i", $auctionTypes[$i] ) ) {
				$this->boPrice = $priceNoCurrencySymbol;
			} else {
				$this->boPrice = "NULL";
			}
		}
	}
	
	public function getKeyValuePairs() {
		return get_object_vars( $this );
	}
}

?>
Return current item: ebay mine