Example #1
0
 public static function getDomainsFromOrder($orderID)
 {
     $domains = array();
     $i = 0;
     $items = OrdersItems::getAllDetails($orderID, null, true);
     if (count($items) > 0) {
         foreach ($items as $item) {
             $params = json_decode($item['parameters'], true);
             if (!empty($params['domain'])) {
                 $domains[$i]['orderitem_id'] = $item['detail_id'];
                 $domains[$i]['customer_id'] = $item['Orders']['Customers']['customer_id'];
                 $domains[$i]['action'] = !empty($params['action']) ? $params['action'] : "registerDomain";
                 $domains[$i]['domain'] = trim(strtolower($params['domain']));
                 $domains[$i]['authinfocode'] = !empty($params['authinfocode']) ? trim($params['authinfocode']) : "";
                 $domains[$i]['tld_id'] = Domains::getDomainIDbyName($domains[$i]['domain']);
                 $domains[$i]['registrar_id'] = Domains::getRegistrarsIDbyName($params['domain']);
                 $i++;
             }
         }
     }
     return $domains;
 }