NF_Database_Models_Object

Class NF_Database_Models_Object.

Defined (1)

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

/includes/Database/Models/Object.php  
  1. final class NF_Database_Models_Object extends NF_Abstracts_Model 
  2. protected $_type = 'object'; 
  3.  
  4. protected $_table_name = 'nf3_objects'; 
  5.  
  6. protected $_meta_table_name = 'nf3_object_meta'; 
  7.  
  8. protected $_columns = array( 
  9. 'type',  
  10. 'created_at' 
  11. ); 
  12.  
  13. public function __construct( $db, $id, $parent_id = '', $parent_type = '' ) 
  14. parent::__construct( $db, $id, $parent_id ); 
  15.  
  16. $this->_parent_type = $parent_type; 
  17.  
  18. public function save() 
  19. if( ! $this->_id ) { 
  20.  
  21. $data = array( 'created_at' => time() ); 
  22.  
  23. $result = $this->_db->insert( 
  24. $this->_table_name,  
  25. $data 
  26. ); 
  27.  
  28. $this->_id = $this->_db->insert_id; 
  29.  
  30. $this->_save_settings(); 
  31.  
  32. } // End NF_Database_Models_Object