Caldera_Forms_Entry_Update

Class Caldera_Forms_Entry_Update.

Defined (1)

The class is defined in the following location(s).

/classes/entry/update.php  
  1. class Caldera_Forms_Entry_Update { 
  2.  
  3. /** 
  4. * Update an entry's status 
  5. * @since 1.5.0 
  6. * @param string $new_status 
  7. * @param int|string $entry_id 
  8. * @return bool 
  9. */ 
  10. public static function update_entry_status( $new_status, $entry_id ) { 
  11. $result = Caldera_Forms_Entry_Bulk::change_status( array( $entry_id ), $new_status ); 
  12.  
  13. return is_int( $result ); 
  14.  
  15.  
  16. /** 
  17. * Update a saved field in the database. 
  18. * @since 1.5.0.7 
  19. * @param Caldera_Forms_Entry_Field $field 
  20. * @return int 
  21. */ 
  22. public static function update_field( Caldera_Forms_Entry_Field $field ) { 
  23. global $wpdb; 
  24.  
  25. $wpdb->update( $wpdb->prefix . 'cf_form_entry_values', $field->to_array(), array( 
  26. 'id' => $field->id 
  27. ) ); 
  28.  
  29. return $wpdb->insert_id; 
  30.  
  31. /** 
  32. * Update field value 
  33. * @since 1.5.0.7 
  34. * @param string $field_id Field ID 
  35. * @param int $entry_id Entry ID 
  36. * @param string $value Field value, prepared and sanitized for database. 
  37. */ 
  38. public static function update_field_value( $field_id, $entry_id, $value ) { 
  39. global $wpdb; 
  40.  
  41. $wpdb->update( $wpdb->prefix . 'cf_form_entry_values', array( 
  42. 'value' => $value 
  43. ), array( 
  44. 'field_id' => $field_id,  
  45. 'entry_id' => $entry_id 
  46. ) ); 
  47.