original_string: public function save($model, $id, $data)
      {
          if (is_null($id)) { // insert
              $model->data = $this->sendCollectionRequest($model, $this->insert_mode, $data);
              $model->id = $model->data ? $model->data[$model->id_field] : null;
          } else { // update
              $model->data = $this->sendItemRequest($model, $id, $this->update_mode, $data);
              $model->id = $model->data ? $model->data[$model->id_field] : null;
          }
  
          return $model->id;
      }
code: public function save($model, $id, $data)
      {
          if (is_null($id)) { // insert
              $model->data = $this->sendCollectionRequest($model, $this->insert_mode, $data);
              $model->id = $model->data ? $model->data[$model->id_field] : null;
          } else { // update
              $model->data = $this->sendItemRequest($model, $id, $this->update_mode, $data);
              $model->id = $model->data ? $model->data[$model->id_field] : null;
          }
  
          return $model->id;
      }
code_tokens: public function save ( $ model , $ id , $ data ) { if ( is_null ( $ id ) ) { // insert $ model -> data = $ this -> sendCollectionRequest ( $ model , $ this -> insert_mode , $ data ) ; $ model -> id = $ model -> data ? $ model -> data [ $ model -> id_field ] : null ; } else { // update $ model -> data = $ this -> sendItemRequest ( $ model , $ id , $ this -> update_mode , $ data ) ; $ model -> id = $ model -> data ? $ model -> data [ $ model -> id_field ] : null ; } return $ model -> id ; }
docstring: Saving, updating and deleting data
docstring_tokens: Saving updating and deleting data