Exemplo n.º 1
0
 /**
  * @see PMXI_Model_Record::insert()
  */
 public function insert()
 {
     $file_contents = NULL;
     if ($this->offsetExists('contents')) {
         $file_contents = $this['contents'];
         unset($this->contents);
     }
     parent::insert();
     $uploads = wp_upload_dir();
     if (isset($this->id) and !is_null($file_contents)) {
         file_put_contents($uploads['basedir'] . '/wpallimport/history/' . $this->id, $file_contents);
     }
     $list = new PMXI_File_List();
     $list->sweepHistory();
     return $this;
 }