original_string: public function saveOrFail(EntityInterface $entity, $options = [])
      {
          $saved = $this->save($entity, $options);
          if ($saved === false) {
              throw new PersistenceFailedException($entity, ['save']);
          }
  
          return $saved;
      }
code: public function saveOrFail(EntityInterface $entity, $options = [])
      {
          $saved = $this->save($entity, $options);
          if ($saved === false) {
              throw new PersistenceFailedException($entity, ['save']);
          }
  
          return $saved;
      }
code_tokens: public function saveOrFail ( EntityInterface $ entity , $ options = [ ] ) { $ saved = $ this -> save ( $ entity , $ options ) ; if ( $ saved === false ) { throw new PersistenceFailedException ( $ entity , [ 'save' ] ) ; } return $ saved ; }
docstring: Try to save an entity or throw a PersistenceFailedException if the application rules checks failed,
  the entity contains errors or the save was aborted by a callback.
  
  @param \Cake\Datasource\EntityInterface $entity the entity to be saved
  @param array|\ArrayAccess $options The options to use when saving.
  @return \Cake\Datasource\EntityInterface
  @throws \Cake\ORM\Exception\PersistenceFailedException When the entity couldn't be saved
  @see \Cake\ORM\Table::save()
docstring_tokens: Try to save an entity or throw a PersistenceFailedException if the application rules checks failed the entity contains errors or the save was aborted by a callback .