本文整理匯總了PHP中Zend_Service_Ebay_Finding類的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Service_Ebay_Finding類的具體用法?PHP Zend_Service_Ebay_Finding怎麽用?PHP Zend_Service_Ebay_Finding使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Zend_Service_Ebay_Finding類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testConstructor
public function testConstructor()
{
$this->assertEquals('EBAY-US', $this->_finding->getOption(Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID));
$this->assertEquals('foo', $this->_finding->getOption(Zend_Service_Ebay_Finding::OPTION_APP_ID));
$options = array(Zend_Service_Ebay_Finding::OPTION_APP_ID => 'app-id', Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID => 'EBAY-GB', 'foo' => 'bar');
$finding = new Zend_Service_Ebay_Finding($options);
$this->assertEquals('EBAY-GB', $finding->getOption(Zend_Service_Ebay_Finding::OPTION_GLOBAL_ID));
$this->assertEquals('app-id', $finding->getOption(Zend_Service_Ebay_Finding::OPTION_APP_ID));
$this->assertEquals('bar', $finding->getOption('foo'));
$this->setExpectedException('Zend_Service_Ebay_Finding_Exception');
$finding = new Zend_Service_Ebay_Finding(array('foo' => 'bar'));
}
示例2: testItemsPagination
public function testItemsPagination()
{
// page 1
// make sure this search will generate more than one page as result
$page1 = $this->_finding->findItemsByKeywords('laptop');
$this->assertEquals(1, $page1->paginationOutput->pageNumber);
// out of range, page #0
try {
$page1->page($this->_finding, 0);
$this->fail('No exception found for page #0');
} catch (Exception $e) {
$this->assertTrue($e instanceof Zend_Service_Ebay_Finding_Exception);
$this->assertContains('Page number ', $e->getMessage());
}
// out of range, one page after last one
try {
$number = $page1->paginationOutput->totalPages + 1;
$page1->page($this->_finding, $number);
$this->fail("No exception found for page out of range #{$number}");
} catch (Exception $e) {
$this->assertTrue($e instanceof Zend_Service_Ebay_Finding_Exception);
$this->assertContains('Page number ', $e->getMessage());
}
// page next
$page2 = $page1->pageNext($this->_finding);
$this->assertEquals(2, $page2->paginationOutput->pageNumber);
// previous
$previous = $page2->pagePrevious($this->_finding);
$this->assertEquals(1, $previous->paginationOutput->pageNumber);
$this->assertNull($page1->pagePrevious($this->_finding));
// first
$first = $page2->pageFirst($this->_finding);
$this->assertEquals(1, $first->paginationOutput->pageNumber);
// last
$last = $page2->pageLast($this->_finding);
$this->assertNotEquals(1, $last->paginationOutput->pageNumber);
// page #2
$some = $page1->page($this->_finding, 2);
$this->assertEquals(2, $some->paginationOutput->pageNumber);
}
示例3: findItemsByProduct
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItemsByProduct(Zend_Service_Ebay_Finding $proxy, $options = null)
{
$type = $this->attributes('productId', 'type');
return $proxy->findItemsByProduct($this->productId, $type, $options);
}
示例4: _initXPath
/**
* Load DOMXPath for current DOM object.
*
* @see Zend_Service_Ebay_Finding::_parseResponse()
* @return void
*/
protected function _initXPath()
{
$document = $this->_dom->ownerDocument;
if (!isset($document->ebayFindingXPath)) {
$xpath = new DOMXPath($document);
foreach (Zend_Service_Ebay_Finding::getXmlNamespaces() as $alias => $uri) {
$xpath->registerNamespace($alias, $uri);
}
$document->ebayFindingXPath = $xpath;
}
$this->_xPath = $document->ebayFindingXPath;
}
示例5: findItems
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItems(Zend_Service_Ebay_Finding $proxy, $options = null)
{
return $proxy->findItemsInEbayStores($this->storeName, $options);
}
示例6: findItems
/**
* @param Zend_Service_Ebay_Finding $proxy
* @param Zend_Config|array $options
* @return Zend_Service_Ebay_Finding_Response_Items
*/
public function findItems(Zend_Service_Ebay_Finding $proxy, $options = null)
{
return $proxy->findItemsByCategory($this->categoryId, $options);
}