/** * create did number for order * @link http://open.didww.com/index.php/5._Order_Create * @param Order $order * @return DIDNumber */ public static function create(Order $order) { $properties = self::getClientInstance()->call('ordercreate', $order->toArray(array('includeNumber' => false))); $did = new DIDNumber($order); $did->getOrder()->setCityId($properties['city_id']); unset($properties['result'], $properties['autorenew_enable'], $properties['city_prefix'], $properties['country_iso'], $properties['country_iso'], $properties['city_id']); $did->fromArray($properties); return $did; }
/** * create DIDNumber using DIDWW API2 * @return Order */ function createNumber() { if (!$this->getNumber() instanceof DIDNumber || !$this->getNumber()->getDIDNumber()) { $tmpHash = false; if (!$this->uniqHash) { $tmpHash = true; $this->uniqHash = $this->generateUniqueHash(); } $this->_number = DIDNumber::create($this); if ($tmpHash) { $this->uniqHash = NULL; } } return $this; }