/** Planets allow for getting information about our solar system. Version 1.04 - Has been simplified and technical specifications make knowing what to use easier Version 1.03 - Adding addition return information, simplified and standardized parameters Version 1.02 - Some major bugs are being fixed - mostly moon data. Version 1.01 - No longer uses nusoap! */ class planets{ /** Connects to the webservice @var soapClient */ public $ws; public $serverId; /** This is to call hidden functions */ public function __call($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to call functions using old code */ public function __soapCall($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to set cookie values functions */ public function setCookies($cookies_csv){ if($cookies_csv != null){ $splitCookies = explode(",",$cookies_csv); foreach($splitCookies as $currentCookie){ $subSplit= explode("=",$currentCookie); $this->ws->__setCookie($subSplit[0], $subSplit[1]); } } } /** Must be called as it loads the class Data */ public function __construct($cookies_csv=null){ $this->serverId="http://soap.peterdownie.com/webServices/planets/server.php"; $this->ws = new SoapClient(null,array("uri"=>"$this->serverId","location"=>"$this->serverId")); $this->setCookies($cookies_csv); return $this->ws->__soapCall("__construct",array()); } /** Returns possible planetProperty values */ public function planet_properties_available(){ return $this->ws->__soapCall("planet_properties_available",array()); } /** Get all of the XML data from the file" */ public function return_solar_system_raw_data(){ return $this->ws->__soapCall("return_solar_system_raw_data",array()); } /** Gets all of the planet names, includes the dwarf planet pluto Use with input planetName */ public function return_solar_system_planet_names(){ return $this->ws->__soapCall("return_solar_system_planet_names",array()); } /** returns all of the moons for each planet in the array. THe moons are case sensitive and can be found with return_solar_system_planet_names The data is an array of the planet names with a csv of the moons. */ public function return_moons_by_planet_array($planetName_array){ return $this->ws->__soapCall("return_moons_by_planet_array",array($planetName_array)); } /** get a specific planet property use return_solar_system_planet_names to find valid planets(they are case sensitive) valid properties are */ public function returnPlanetProperty($planetName,$planetProperty){ return $this->ws->__soapCall("returnPlanetProperty",array($planetName,$planetProperty)); } /** gets a property for multiple planets, which are included in an array, this is similiar return Planet Property but was made to help reduce calls to the server for low end internet connections. Description is a boolean that has a item called Description with the query */ public function returnPlanetPropertyForMultiplePlanets($planetName_array,$planetProperty){ return $this->ws->__soapCall("returnPlanetPropertyForMultiplePlanets",array($planetName_array,$planetProperty)); } /** uses the same properties as returnPlanetProperty, this allows you to get multiple properties for one planet, this reduces delay instead of calling a planet one by one. The search planet must be a legal planet and is case sensitive, you can find out the names with return_solar_system_planet_names, must have a capital in front. Description is a boolean with default of true You can disable it by setting it to false */ public function returnSinglePlanetWithMultipleProperties($planetName,$planetProperty_array){ return $this->ws->__soapCall("returnSinglePlanetWithMultipleProperties",array($planetName,$planetProperty_array)); } /** This function returns Multiple Planets and Multiple Properties, it uses the same properties as returnPlanetProperty, it also uses the input of planets that can be discovered with return_solar_system_planet_names */ public function returnMultiplePropertiesForMultiplePlanets($planetName_array,$planetProperty_array){ return $this->ws->__soapCall("returnMultiplePropertiesForMultiplePlanets",array($planetName_array,$planetProperty_array)); } }