예제 #1
0
 public function markItemAsModified($post_id)
 {
     global $wpdb;
     // get single listing for post_id
     $listing_id = WPLE_ListingQueryHelper::getListingIDFromPostID($post_id);
     $this->reapplyProfileToItem($listing_id);
     // process all listings for post_id
     $listings = WPLE_ListingQueryHelper::getAllListingsFromPostID($post_id);
     if (is_array($listings) && sizeof($listings) > 1) {
         foreach ($listings as $listing_item) {
             $this->reapplyProfileToItem($listing_item->id);
         }
     }
     // process split variations - fetched by parent_id
     $listings = WPLE_ListingQueryHelper::getAllListingsFromParentID($post_id);
     if (is_array($listings)) {
         foreach ($listings as $listing_item) {
             $this->reapplyProfileToItem($listing_item->id);
             WPLE()->logger->info('reapplied profile to SPLIT variation for post_id ' . $post_id . ' - listing_id: ' . $listing_item->id);
         }
     }
     return $listing_id;
     // set published items to changed
     // $wpdb->update( $this->tablename, array( 'status' => 'changed' ), array( 'status' => 'published', 'post_id' => $post_id ) );
     // set verified items to prepared
     // $wpdb->update( $this->tablename, array( 'status' => 'prepared' ), array( 'status' => 'verified', 'post_id' => $post_id ) );
 }