/** * Removes a dbst field from dbst table * @author Howard R <*****@*****.**> * @static * @param int $dbst_id * @return boolean */ public static function remove_dbst($dbst_id) { /** first validation **/ if (!$dbst_id) { return false; } /** Multilingual **/ if (wpl_global::check_addon('pro')) { wpl_addon_pro::remove_multilingual($dbst_id); } /** trigger event **/ wpl_global::event_handler('dbst_removed', $dbst_id); wpl_db::delete("wpl_dbst", $dbst_id); }
/** * Purge a property completely * @author Howard <*****@*****.**> * @static * @param int $property_id * @param boolean $trigger_event * @return boolean */ public static function purge($property_id, $trigger_event = true) { /** first validation **/ if (!trim($property_id)) { return false; } $property_data = self::get_property_raw_data($property_id); /** trigger event **/ if ($trigger_event) { wpl_global::event_handler('property_before_purge', array('property_id' => $property_id, 'property_data' => $property_data)); } /** purging property related data **/ _wpl_import('libraries.items'); wpl_items::delete_all_items($property_id, $property_data['kind']); /** purging property record **/ wpl_db::delete('wpl_properties', $property_id); /** purging property folder **/ wpl_folder::delete(wpl_items::get_path($property_id)); /** trigger event **/ if ($trigger_event) { wpl_global::event_handler('property_purged', array('property_id' => $property_id, 'property_data' => $property_data)); } return true; }
/** * Deletes an item record from items table * @author Howard R <*****@*****.**> * @static * @param int $item_id * @return boolean */ public static function delete($item_id) { /** trigger event **/ wpl_global::event_handler('item_deleted', array('item_id' => $item_id)); /** delete item **/ return wpl_db::delete('wpl_items', $item_id); }
/** * Removes a dbst field from dbst table * @author Howard R <*****@*****.**> * @static * @param int $dbst_id * @return boolean */ public static function remove_dbst($dbst_id) { /** first validation **/ if (!$dbst_id) { return false; } /** Multilingual **/ if (wpl_global::check_addon('pro')) { wpl_addon_pro::remove_multilingual($dbst_id); } wpl_db::delete("wpl_dbst", $dbst_id); }