예제 #1
0
 function synchronous()
 {
     global $toC_Json, $osC_Language;
     if (!isset($_SESSION['gSearchToken']) && empty($_SESSION['gSearchToken'])) {
         osC_GoogleBase_Admin::clientLoginSearch();
     }
     $response = osC_GoogleBase_Admin::synchronous();
     print_r($response);
 }
예제 #2
0
 function deleteProduct($item_id)
 {
     global $osC_Database;
     $Qselect = $osC_Database->query('select google_base_id, items_edit_link from :table_google_base_items where google_base_id = :google_base_id');
     $Qselect->bindTable(':table_google_base_items', TABLE_GOOGLE_BASE_ITEMS);
     $Qselect->bindInt(':google_base_id', $item_id);
     $Qselect->execute();
     $product_info = $Qselect->toArray();
     $product_link = $product_info['items_edit_link'];
     if (!isset($_SESSION['gContentToken']) && empty($_SESSION['gContentToken'])) {
         osC_GoogleBase_Admin::clientLoginContentApi();
     }
     $header = array('Authorization: GoogleLogin Auth=' . trim($_SESSION['gContentToken']));
     self::sendRequestToGoogleBase($product_link, '', $header, 'delete');
     $Qdel = $osC_Database->query('delete from :table_google_base_items where google_base_id = :google_base_id');
     $Qdel->bindTable(':table_google_base_items', TABLE_GOOGLE_BASE_ITEMS);
     $Qdel->bindInt(':google_base_id', $item_id);
     $Qdel->execute();
     if ($Qdel->affectedRows() > 0) {
         return true;
     } else {
         return false;
     }
 }