/** * constructor * every time new object is created, Api method is called */ public function __construct() { parent::__construct(); $properties = $this->call('getdidwwapidetails', array()); $properties = (array) $properties; unset($properties['result']); unset($properties['error']); $this->fromArray($properties); }
/** * Construct new didnumber object * @param Order $order */ function __construct(Order $order = NULL) { $this->setOrder($order); parent::__construct(); }
<?php /* * ***************************************** */ /* Norman SampleShare Client Framework */ /* Version 1.30 */ /* Created by Trygve Brox - Norman ASA - 2010 */ /* * ***************************************** */ include "server_includes.php"; $share = new ServerObject(); if ($share->uri_action == "") { die; } $user = new UserObject($share->sql, $share->uri_user); $share->virex_currentUser = $user; $share->virex_init(); if ($share->uri_action == "getlist" && isset($_REQUEST["from"])) { $plaintext = $share->get_list(); $encrypted = ''; $encrypted = $share->encrypt_file($plaintext, $user->key_name); if (!file_exists($encrypted)) { die("ERROR! => Error encrypting hashlist!"); } $contents = file_get_contents($encrypted); if ($share->verify_gpg($contents)) { $share->send_headers("hashlist.gpg", filesize($encrypted)); echo $contents; } else { echo "ERROR! => Unable to encrypt list"; } @unlink($encfile); @unlink($encrypted);
/** * Object::fromArray overriding * @param array $array * * <code> * $country = new Country(); * $country->fromArray(array('country_iso'=>'UA')); * echo $country->loadCities()->loadPSTNNetworks(); * </code> */ function fromArray($array = array()) { if (isset($array['cities'])) { if (is_array($array['cities'])) { $this->setCitiesFromArray($array['cities']); $this->_loadedCities = true; } unset($array['cities']); } if (isset($array['networks'])) { if (is_array($array['networks'])) { $this->setPSTNNetworksFromArray($array['networks']); $this->_loadedNetworks = true; } unset($array['networks']); } parent::fromArray($array); }