예제 #1
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // run customizations required by this particular class
     // set custom nameservers to nameserver_list
     if (isset($dataObject->data)) {
         if ($dataObject->data->custom_nameservers == 1) {
             $newDataObject->attributes->nameserver_list = array();
             for ($j = 1; $j <= 10; ++$j) {
                 $tns = 'name' . $j;
                 $tso = 'sortorder' . $j;
                 if (isset($dataObject->data->{$tns}) && $dataObject->data->{$tns} != '' && isset($dataObject->data->{$tso}) && $dataObject->data->{$tso}) {
                     $nameserver = new \stdClass();
                     $nameserver->name = $dataObject->data->{$tns};
                     $nameserver->sortorder = $dataObject->data->{$tso};
                     $newDataObject->attributes->nameserver_list[] = $nameserver;
                 }
             }
         }
     }
     if (isset($dataObject->personal)) {
         $newDataObject->attributes->contact_set = new \stdClass();
         $newDataObject->attributes->contact_set->owner = $dataObject->personal;
         $newDataObject->attributes->contact_set->admin = $dataObject->personal;
         $newDataObject->attributes->contact_set->billing = $dataObject->personal;
         $newDataObject->attributes->contact_set->tech = $dataObject->personal;
     }
     // end customizations
     return $newDataObject;
 }
예제 #2
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     $tlds = array();
     if (isset($dataObject->data->selected) && $dataObject->data->selected) {
         $tlds = explode(';', $dataObject->data->selected);
     }
     if (empty($tlds) && isset($dataObject->data->defaulttld) && $dataObject->data->defaulttld) {
         $tlds = explode(';', $dataObject->data->defaulttld);
     }
     if (empty($tlds)) {
         $tlds = $this->defaultTlds;
     }
     /*
      * setting service_override
      */
     $newDataObject->attributes->service_override = new \stdClass();
     $service_override = new \stdCLass();
     $service_override->tlds = $tlds;
     if (isset($dataObject->data->maximum) && $dataObject->data->maximum) {
         $service_override->maximum = $dataObject->data->maximum;
     }
     $newDataObject->attributes->service_override->suggestion = $service_override;
     $newDataObject->attributes->services = array('suggestion');
     /* end setting service_override **/
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // run customizations required by this particular class
     // set custom nameservers to nameserver_list
     if (isset($dataObject->data->nameserver_names) && $dataObject->data->nameserver_names != '') {
         $nameServers = explode(',', $dataObject->data->nameserver_names);
         if (isset($dataObject->data->nameserver_ips) && $dataObject->data->nameserver_ips != '') {
             $ipAddresses = explode(',', $dataObject->data->nameserver_ips);
         } else {
             $ipAddresses = array();
         }
         $i = 0;
         $newDataObject->attributes->nameserver_list = array();
         for ($i = 0; $i < count($nameServers); ++$i) {
             $nameserver_obj = new \stdClass();
             $nameserver_obj->fqdn = $nameServers[$i];
             if (isset($ipAddresses[$i])) {
                 $nameserver_obj->fqdn = $ipAddresses[$i];
             }
         }
     }
     // end customizations
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     return $newDataObject;
 }
예제 #5
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     $newDataObject->attributes->add_to_all_registry = explode(',', $newDataObject->attributes->add_to_all_registry);
     return $newDataObject;
 }
예제 #6
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     if (!is_array($newDataObject->attributes->change_items)) {
         $newDataObject->attributes->change_items = explode(',', $newDataObject->attributes->change_items);
     }
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // make sure attributes->reg_domain is set, even if it's
     // an empty string
     if (!isset($newDataObject->attributes->reg_domain)) {
         $newDataObject->attributes->reg_domain = '';
     }
     return $newDataObject;
 }
예제 #8
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // run old 'getTlds' method (now called 'getServiceOverride') to get
     // info that should be part of service override entries
     $newDataObject->attributes->service_override = $this->getServiceOverride($dataObject);
     $newDataObject->attributes->services = array('lookup', 'suggestion');
     /* end setting service_override **/
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // set attributes->domain_list
     if (!is_object($newDataObject->attributes)) {
         $newDataObject->attributes = new \stdClass();
     }
     $newDataObject->attributes->domain_list = explode(',', $dataObject->data->domain_list);
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // run customizations required by this particular class
     // make sure attributes->types is an array on the new
     // object
     if (!is_array($newDataObject->attributes->types)) {
         $newDataObject->attributes->types = explode(',', $newDataObject->attributes->types);
     }
     // end customizations
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // run customizations required by this particular class
     if (isset($newDataObject->contact_set) && isset($dataObject->personal)) {
         $newDataObject->contact_set = new \stdClass();
         $contact_types = explode(',', $dataObject->data->contact_type);
         foreach ($contact_types as $contact_type) {
             $newDataObject->contact_set->{$contact_type} = $dataObject->personal;
         }
     }
     // end customizations
     return $newDataObject;
 }
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     /*
      * Convert fields that should be arrays to arrays
      */
     if (isset($newDataObject->attributes->add_ns)) {
         $newDataObject->attributes->add_ns = explode(',', $newDataObject->attributes->add_ns);
     }
     if (isset($newDataObject->attributes->assign_ns)) {
         $newDataObject->attributes->assign_ns = explode(',', $newDataObject->attributes->assign_ns);
     }
     if (isset($newDataObject->attributes->remove_ns)) {
         $newDataObject->attributes->remove_ns = explode(',', $newDataObject->attributes->remove_ns);
     }
     return $newDataObject;
 }
예제 #13
0
 public function convertDataObject($dataObject, $newStructure = null)
 {
     $p = new parent();
     if (is_null($newStructure)) {
         $newStructure = $this->newStructure;
     }
     $newDataObject = $p->convertDataObject($dataObject, $newStructure);
     // explode change_items into an array
     // if it isn't already
     if (!is_array($newDataObject->attributes->change_items)) {
         $newDataObject->attributes->change_items = explode(',', $newDataObject->attributes->change_items);
     }
     // build attributes->contacts array.
     // data->type is the contact_type,
     // data->personal is the contact record
     if (isset($dataObject->data->type) && $dataObject->data->type != '' && isset($dataObject->personal) && $dataObject->personal != '') {
         $newDataObject->attributes->contacts = array();
         $contact_types = explode(',', $dataObject->data->type);
         foreach ($contact_types as $i => $contact_type) {
             $contact = new \stdClass();
             $contact->set = $dataObject->personal;
             $contact->type = $contact_type;
             $newDataObject->attributes->contacts[] = $contact;
             unset($contact);
         }
     }
     // explode *_ns fields into arrays if they exist
     // and are not already arrays
     if (isset($newDataObject->attributes->add_ns) && !is_array($newDataObject->attributes->add_ns)) {
         $newDataObject->attributes->add_ns = explode(',', $newDataObject->attributes->add_ns);
     }
     if (isset($newDataObject->attributes->remove_ns) && !is_array($newDataObject->attributes->remove_ns)) {
         $newDataObject->attributes->remove_ns = explode(',', $newDataObject->attributes->remove_ns);
     }
     if (isset($newDataObject->attributes->assign_ns) && !is_array($newDataObject->attributes->assign_ns)) {
         $newDataObject->attributes->assign_ns = explode(',', $newDataObject->attributes->assign_ns);
     }
     return $newDataObject;
 }