public function save()
    {
        $data = $this->getData();
        if (!$this->currentId)
        {
            $config = $this->config();
            $config->last_id++;

            $this->setField('id', $config->last_id);
            array_push($data, $this->set);

            Helpers\Config::table($this->name)->put($config);
        }
        else
        {
            $this->setField('id', $this->currentId);
            $data[$this->currentKey] = $this->set;
        }

        Helpers\Data::table($this->name)->put($data);

//         $this->setFields();
    }
public function save()
    {
        $data = $this->getData();
        if (!$this->currentId)
        {
            $config = $this->config();
            $config->last_id++;

            $this->setField('id', $config->last_id);
            array_push($data, $this->set);

            Helpers\Config::table($this->name)->put($config);
        }
        else
        {
            $this->setField('id', $this->currentId);
            $data[$this->currentKey] = $this->set;
        }

        Helpers\Data::table($this->name)->put($data);

//         $this->setFields();
    }
public function save ( ) { $ data = $ this -> getData ( ) ; if ( ! $ this -> currentId ) { $ config = $ this -> config ( ) ; $ config -> last_id ++ ; $ this -> setField ( 'id' , $ config -> last_id ) ; array_push ( $ data , $ this -> set ) ; Helpers \ Config :: table ( $ this -> name ) -> put ( $ config ) ; } else { $ this -> setField ( 'id' , $ this -> currentId ) ; $ data [ $ this -> currentKey ] = $ this -> set ; } Helpers \ Data :: table ( $ this -> name ) -> put ( $ data ) ; //         $this->setFields(); }
Saving inserted or updated data
Saving inserted or updated data