NF_Database_Models_Field

Class NF_Database_Models_Field.

Defined (1)

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

/includes/Database/Models/Field.php  
  1. final class NF_Database_Models_Field extends NF_Abstracts_Model 
  2. private $form_id = ''; 
  3.  
  4. protected $_type = 'field'; 
  5.  
  6. protected $_table_name = 'nf3_fields'; 
  7.  
  8. protected $_meta_table_name = 'nf3_field_meta'; 
  9.  
  10. protected $_columns = array( 
  11. 'label',  
  12. 'key',  
  13. 'parent_id',  
  14. 'type',  
  15. 'created_at' 
  16. ); 
  17. public function __construct( $db, $id, $parent_id = '' ) 
  18. parent::__construct( $db, $id, $parent_id ); 
  19.  
  20. public static function import( array $settings, $field_id = '', $is_conversion = FALSE ) 
  21. $settings = apply_filters( 'ninja_forms_before_import_fields', $settings ); 
  22. $settings[ 'saved' ] = 1; 
  23.  
  24. if( $field_id && $is_conversion ) { 
  25. $field = Ninja_Forms()->form()->field( $field_id )->get(); 
  26. } else { 
  27. $field = Ninja_Forms()->form()->field()->get(); 
  28. $field->update_settings( $settings ); 
  29. $field->save(); 
  30.  
  31. } // End NF_Database_Models_Field