Example #1
0
 /**
  * Get a stock quote for a company and save to database.
  * If not successful then raise a soft error event.
  *
  * @param object $company
  */
 protected function getQuote($company)
 {
     try {
         $quote = (double) $this->soap->getQuote($this->options, $company->symbol);
         Stock::addQuote($company->symbol, $quote);
     } catch (Exception $exception) {
         $this->raiseEvent($company->symbol, $exception, 'Could not retrieve quote data for ' . $company->name);
     }
 }
<?php

$client = new SoapClient("stockquote2.wsdl");
print $client->getQuote("ibm");