PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
wiloke-listing-tools
/
app
/
Models
<?php namespace WilokeListingTools\Models; use WilokeListingTools\AlterTable\AlterTableBusinessHourMeta; class BusinessHourMeta { public static function add($postID, $metaKey, $metaVal) { global $wpdb; $table = $wpdb->prefix.AlterTableBusinessHourMeta::$tblName; $metaVal = maybe_serialize($metaVal); return $wpdb->insert( $table, [ 'objectID' => $postID, 'meta_key' => $metaKey, 'meta_value' => $metaVal ], [ '%d', '%s', '%s' ] ); } public static function delete($postID, $metaKey) { global $wpdb; $table = $wpdb->prefix.AlterTableBusinessHourMeta::$tblName; return $wpdb->delete( $table, [ 'objectID' => $postID, 'meta_key' => $metaKey ], [ '%d', '%s' ] ); } public static function get($postID, $metaKey) { global $wpdb; $table = $wpdb->prefix.AlterTableBusinessHourMeta::$tblName; $metaKey = $wpdb->_real_escape($metaKey); $val = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $table WHERE meta_key=%s AND objectID=%d", $metaKey, $postID ) ); return maybe_unserialize($val); } public static function getMetaID($postID, $metaKey) { global $wpdb; $table = $wpdb->prefix.AlterTableBusinessHourMeta::$tblName; $metaKey = $wpdb->_real_escape($metaKey); $val = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $table WHERE meta_key=%s AND objectID=%d", $metaKey, $postID ) ); return $val; } public static function updateByMetaID($metaID, $metaKey, $metaVal) { global $wpdb; $table = $wpdb->prefix.AlterTableBusinessHourMeta::$tblName; return $wpdb->update( $table, [ 'meta_value' => $metaVal ], [ 'ID' => $metaID ], [ '%s' ], [ '%d' ] ); } public static function update($postID, $metaKey, $metaVal) { if ($metaID = self::getMetaID($postID, $metaKey)) { return self::updateByMetaID($metaID, $metaKey, $metaVal); } return self::add($postID, $metaKey, $metaVal); } }
[+]
..
[-] 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]