Automator_DB_Handler_Closures
Source Source
File: src/core/lib/utilities/db/class-automator-db-handler-closures.php
class Automator_DB_Handler_Closures { /** * @var */ public static $instance; /** * @return Automator_DB_Handler_Closures */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * @return array */ public function get_all() { global $wpdb; return $wpdb->get_col( $wpdb->prepare( "SELECT cp.ID FROM $wpdb->posts cp LEFT JOIN $wpdb->posts rp ON rp.ID = cp.post_parent WHERE cp.post_type LIKE %s AND cp.post_status LIKE %s AND rp.post_status LIKE %s LIMIT 1", 'uo-closure', 'publish', 'publish' ) ); } /** * @param int $closure_id */ public function delete( int $closure_id ) { global $wpdb; // delete from uap_closure_log $wpdb->delete( $wpdb->prefix . Automator()->db->tables->closure, array( 'automator_closure_id' => $closure_id ) ); // delete from uap_closure_log_meta $wpdb->delete( $wpdb->prefix . Automator()->db->tables->closure_meta, array( 'automator_closure_id' => $closure_id ) ); } }
Expand full source code Collapse full source code View on Github
Methods Methods
- add_entry — Adds an entry to the closure log.
- add_entry_meta — Adds an entry to the closures log table.
- delete
- delete_by_recipe_id
- delete_logs
- get_all
- get_entry_meta — Retrieve an entry meta value from the closures log meta table.
- get_instance