original_string: public function save($entity)
      {
          if ($this->idProperty->getValue($entity) === null) {
              return $this->insert($entity);
          } else {
              return $this->update($entity);
          }
  
      }
code: public function save($entity)
      {
          if ($this->idProperty->getValue($entity) === null) {
              return $this->insert($entity);
          } else {
              return $this->update($entity);
          }
  
      }
code_tokens: public function save ( $ entity ) { if ( $ this -> idProperty -> getValue ( $ entity ) === null ) { return $ this -> insert ( $ entity ) ; } else { return $ this -> update ( $ entity ) ; } }
docstring: Insert an entity into the database if it has no id yet. Otherwise update it by id.
  @param mixed $entity the entity
  @return int the id of the saved document
  @throws ConfigurationException if no idProperty was set
docstring_tokens: Insert an entity into the database if it has no id yet . Otherwise update it by id .