PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Models
<?php namespace WilokeListingTools\Models; use WilokeListingTools\Framework\Helpers\SetSettings; class PostMetaModel { public static function getExpiryTimeTemporary($postID) { global $wpdb; return $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $postID, 'wilcity_expiry_time_temporary' ) ); } /** * @param $postID * @param $expirationTimestamp * * @return false|int */ public static function setExpiryTimeTemporary($postID, $expirationTimestamp) { global $wpdb; $metaID = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $postID, 'wilcity_expiry_time_temporary' ) ); if (empty($metaID)) { $wpdb->insert( $wpdb->postmeta, [ 'post_id' => $postID, 'meta_key' => 'wilcity_expiry_time_temporary', 'meta_value' => $expirationTimestamp ], [ '%d', '%s', '%d', ] ); return $wpdb->insert_id; } else { return $wpdb->update( $wpdb->postmeta, [ 'meta_value' => $expirationTimestamp ], [ 'post_id' => $postID, 'meta_key' => 'wilcity_expiry_time_temporary' ], [ '%d' ], [ '%d', '%s' ] ); } } /** * @param $postID * @param $expirationTimestamp * * @return false|int */ public static function updateListingExpiration($postID, $expirationTimestamp) { global $wpdb; $metaID = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $postID, 'wilcity_post_expiry' ) ); if (empty($metaID)) { $wpdb->insert( $wpdb->postmeta, [ 'post_id' => $postID, 'meta_key' => 'wilcity_post_expiry', 'meta_value' => $expirationTimestamp ], [ '%d', '%s', '%d', ] ); return $wpdb->insert_id; } else { return $wpdb->update( $wpdb->postmeta, [ 'meta_value' => $expirationTimestamp ], [ 'post_id' => $postID, 'meta_key' => 'wilcity_post_expiry' ], [ '%d' ], [ '%d', '%s' ] ); } } }
[+]
..
[-] InvoiceMetaModel.php
[edit]
[-] PaymentMetaModel.php
[edit]
[-] ViewStatistic.php
[edit]
[-] WooCommerceModel.php
[edit]
[-] FavoriteStatistic.php
[edit]
[-] ReviewMetaModel.php
[edit]
[-] MessageModel.php
[edit]
[-] PlanRelationshipModel.php
[edit]
[-] ReviewModel.php
[edit]
[-] NotificationsModel.php
[edit]
[-] AbstractUserPlan.php
[edit]
[-] Coupon.php
[edit]
[-] PostModel.php
[edit]
[-] BookingCom.php
[edit]
[-] ListingModel.php
[edit]
[-] BusinessHourMeta.php
[edit]
[-] PromotionModel.php
[edit]
[-] SharesStatistic.php
[edit]
[-] ReportModel.php
[edit]
[-] InvoiceModel.php
[edit]
[-] RemainingItems.php
[edit]
[-] PaymentModel.php
[edit]
[-] PayPalMetaModel.php
[edit]
[-] PostMetaModel.php
[edit]
[-] FollowerModel.php
[edit]
[-] UserModel.php
[edit]
[-] EventModel.php
[edit]