public function duplicate($new_id = null)
    {
        $this->id = null;

        if ($this->id_field) {
            $this[$this->id_field] = $new_id;
        }

        return $this;
    }
public function duplicate($new_id = null)
    {
        $this->id = null;

        if ($this->id_field) {
            $this[$this->id_field] = $new_id;
        }

        return $this;
    }
public function duplicate ( $ new_id = null ) { $ this -> id = null ; if ( $ this -> id_field ) { $ this [ $ this -> id_field ] = $ new_id ; } return $ this ; }
Keeps the model data, but wipes out the ID so
when you save it next time, it ends up as a new
record in the database.

@param mixed|null $new_id

@return $this
Keeps the model data but wipes out the ID so when you save it next time it ends up as a new record in the database .